diff options
author | Julia Lawall <julia@diku.dk> | 2009-08-06 19:05:08 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2009-09-11 02:25:58 -0400 |
commit | 041b5eac254107cd3ba60034c38a411531cc64ee (patch) | |
tree | a1abcfd2b97985ca06504c493fda9cd4123307aa /drivers/ata/sata_mv.c | |
parent | f90f613c3ed7381209de8aa36458442b5130170b (diff) |
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/sata_mv.c')
-rw-r--r-- | drivers/ata/sata_mv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index c19417e02208..17f9ff9067a2 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -4013,7 +4013,7 @@ static int mv_platform_probe(struct platform_device *pdev) | |||
4013 | 4013 | ||
4014 | host->iomap = NULL; | 4014 | host->iomap = NULL; |
4015 | hpriv->base = devm_ioremap(&pdev->dev, res->start, | 4015 | hpriv->base = devm_ioremap(&pdev->dev, res->start, |
4016 | res->end - res->start + 1); | 4016 | resource_size(res)); |
4017 | hpriv->base -= SATAHC0_REG_BASE; | 4017 | hpriv->base -= SATAHC0_REG_BASE; |
4018 | 4018 | ||
4019 | /* | 4019 | /* |