diff options
author | Julia Lawall <julia@diku.dk> | 2009-07-08 07:04:55 +0200 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-07-08 07:48:14 +0200 |
commit | 72398e4b1a4cf55d3698a4f265b638093a470b04 (patch) | |
tree | 497fd88ccf5d3984b9585f52139e2e3b35bf8798 /drivers/input/serio/at32psif.c | |
parent | Input: dm355evm_keys - use threaded IRQs (diff) | |
download | linux-72398e4b1a4cf55d3698a4f265b638093a470b04.tar.xz linux-72398e4b1a4cf55d3698a4f265b638093a470b04.zip |
Input: use resource_size when allocating resources
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>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/serio/at32psif.c')
-rw-r--r-- | drivers/input/serio/at32psif.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/serio/at32psif.c b/drivers/input/serio/at32psif.c index 41fda8c67b1e..a6fb7a3dcc46 100644 --- a/drivers/input/serio/at32psif.c +++ b/drivers/input/serio/at32psif.c @@ -231,7 +231,7 @@ static int __init psif_probe(struct platform_device *pdev) goto out_free_io; } - psif->regs = ioremap(regs->start, regs->end - regs->start + 1); + psif->regs = ioremap(regs->start, resource_size(regs)); if (!psif->regs) { ret = -ENOMEM; dev_dbg(&pdev->dev, "could not map I/O memory\n"); |