diff options
author | Joe Perches <joe@perches.com> | 2011-03-23 15:55:36 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-04-10 11:01:04 -0400 |
commit | 06794eaeb766989e450c1b459ae28da76e1f8719 (patch) | |
tree | 669739c584a5e404e06294d075b990378ef4bf4c /drivers | |
parent | b0c3af5ef0d7b38eb1ba522becd47123ac9736d2 (diff) |
treewide: Fix iomap resource size miscalculations
Convert off-by-1 r->end - r->start to resource_size(r)
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: David Brown <davidb@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/msm/mddi.c | 2 | ||||
-rw-r--r-- | drivers/watchdog/bcm63xx_wdt.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/msm/mddi.c b/drivers/video/msm/mddi.c index b66d86ac7cea..178b0720bd79 100644 --- a/drivers/video/msm/mddi.c +++ b/drivers/video/msm/mddi.c | |||
@@ -679,7 +679,7 @@ static int __devinit mddi_probe(struct platform_device *pdev) | |||
679 | printk(KERN_ERR "mddi: no associated mem resource!\n"); | 679 | printk(KERN_ERR "mddi: no associated mem resource!\n"); |
680 | return -ENOMEM; | 680 | return -ENOMEM; |
681 | } | 681 | } |
682 | mddi->base = ioremap(resource->start, resource->end - resource->start); | 682 | mddi->base = ioremap(resource->start, resource_size(resource)); |
683 | if (!mddi->base) { | 683 | if (!mddi->base) { |
684 | printk(KERN_ERR "mddi: failed to remap base!\n"); | 684 | printk(KERN_ERR "mddi: failed to remap base!\n"); |
685 | ret = -EINVAL; | 685 | ret = -EINVAL; |
diff --git a/drivers/watchdog/bcm63xx_wdt.c b/drivers/watchdog/bcm63xx_wdt.c index 3c5045a206dd..5064e8317521 100644 --- a/drivers/watchdog/bcm63xx_wdt.c +++ b/drivers/watchdog/bcm63xx_wdt.c | |||
@@ -248,7 +248,7 @@ static int __devinit bcm63xx_wdt_probe(struct platform_device *pdev) | |||
248 | return -ENODEV; | 248 | return -ENODEV; |
249 | } | 249 | } |
250 | 250 | ||
251 | bcm63xx_wdt_device.regs = ioremap_nocache(r->start, r->end - r->start); | 251 | bcm63xx_wdt_device.regs = ioremap_nocache(r->start, resource_size(r)); |
252 | if (!bcm63xx_wdt_device.regs) { | 252 | if (!bcm63xx_wdt_device.regs) { |
253 | dev_err(&pdev->dev, "failed to remap I/O resources\n"); | 253 | dev_err(&pdev->dev, "failed to remap I/O resources\n"); |
254 | return -ENXIO; | 254 | return -ENXIO; |