1
0
Fork 0
alistair23-linux/drivers/rapidio
Dan Carpenter 88cf81fc89 rapidio: use resource_size()
The size calculation is done incorrectly here because it should include
both the start and end (end - start + 1).  It's easiest to just use
resource_size() which does the right thing.

I was worried there was something non-standard going on because the
printk() subtracts "end - 1", but the rest of the file uses the normal
resource size calculations.  This function is only called from
fsl_rio_setup() in arch/powerpc/sysdev/fsl_rio.c and the calculation
there is also:

	port->iores.start = law_start;
	port->iores.end = law_start + law_size - 1;

So I think this is the correct fix.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: Alexandre Bounine <alexandre.bounine@idt.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-12 07:55:30 -08:00
..
switches rapidio: fix destructive port EM initialization for Tsi568 2010-10-27 18:03:16 -07:00
Kconfig rapidio: add debug configuration option 2010-05-27 09:12:51 -07:00
Makefile rapidio: add debug configuration option 2010-05-27 09:12:51 -07:00
rio-access.c [RAPIDIO] Add RapidIO multi mport support 2008-04-29 19:40:28 +10:00
rio-driver.c rapidio: fix RapidIO sysfs hierarchy 2010-10-27 18:03:15 -07:00
rio-scan.c rapidio: add handling of redundant routes 2010-10-27 18:03:16 -07:00
rio-sysfs.c rapidio: modify sysfs initialization for switches 2010-10-27 18:03:15 -07:00
rio.c rapidio: use resource_size() 2010-11-12 07:55:30 -08:00
rio.h rapidio: add handling of redundant routes 2010-10-27 18:03:16 -07:00