summaryrefslogtreecommitdiff
path: root/drivers/ata/pata_rb532_cf.c
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2009-08-07 03:05:08 +0400
committerJeff Garzik <jgarzik@redhat.com>2009-09-11 10:25:58 +0400
commit041b5eac254107cd3ba60034c38a411531cc64ee (patch)
treea1abcfd2b97985ca06504c493fda9cd4123307aa /drivers/ata/pata_rb532_cf.c
parentf90f613c3ed7381209de8aa36458442b5130170b (diff)
downloadlinux-041b5eac254107cd3ba60034c38a411531cc64ee.tar.xz
drivers/ata: use resource_size
Use the function resource_size, which reduces the chance of introducing off-by-one errors in calculating the resource size. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ struct resource *res; @@ - (res->end - res->start) + 1 + resource_size(res) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_rb532_cf.c')
-rw-r--r--drivers/ata/pata_rb532_cf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/pata_rb532_cf.c b/drivers/ata/pata_rb532_cf.c
index 8e3cdef8a25f..45f1e10f917b 100644
--- a/drivers/ata/pata_rb532_cf.c
+++ b/drivers/ata/pata_rb532_cf.c
@@ -151,7 +151,7 @@ static __devinit int rb532_pata_driver_probe(struct platform_device *pdev)
info->irq = irq;
info->iobase = devm_ioremap_nocache(&pdev->dev, res->start,
- res->end - res->start + 1);
+ resource_size(res));
if (!info->iobase)
return -ENOMEM;