From: Tobias Klauser Date: Tue, 11 May 2010 07:10:23 +0000 (+0200) Subject: serial: bfin_sport_uart: Use resource size to fix off-by-one error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e114474cf5c7fe7ab94dd4f5938ffa51c9af77c4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git serial: bfin_sport_uart: Use resource size to fix off-by-one error Use the resource_size function instead of manually calculating the resource size. This actually fixes an off-by-one error. Signed-off-by: Tobias Klauser Signed-off-by: Mike Frysinger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/serial/bfin_sport_uart.c b/drivers/serial/bfin_sport_uart.c index 66cda2290de0..e57fb3d228e2 100644 --- a/drivers/serial/bfin_sport_uart.c +++ b/drivers/serial/bfin_sport_uart.c @@ -774,8 +774,7 @@ static int __devinit sport_uart_probe(struct platform_device *pdev) goto out_error_free_peripherals; } - sport->port.membase = ioremap(res->start, - res->end - res->start); + sport->port.membase = ioremap(res->start, resource_size(res)); if (!sport->port.membase) { dev_err(&pdev->dev, "Cannot map sport IO\n"); ret = -ENXIO;