2013-03-17 08:01:43

by Silviu-Mihai Popescu

[permalink] [raw]
Subject: [PATCH] drivers: power: goldfish: use resource_size()

This uses the resource_size() function instead of explicit computation.

Signed-off-by: Silviu-Mihai Popescu <[email protected]>
---
drivers/power/goldfish_battery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/goldfish_battery.c b/drivers/power/goldfish_battery.c
index c10f460..29eba88 100644
--- a/drivers/power/goldfish_battery.c
+++ b/drivers/power/goldfish_battery.c
@@ -178,7 +178,7 @@ static int goldfish_battery_probe(struct platform_device *pdev)
return -ENODEV;
}

- data->reg_base = devm_ioremap(&pdev->dev, r->start, r->end - r->start + 1);
+ data->reg_base = devm_ioremap(&pdev->dev, r->start, resource_size(r));
if (data->reg_base == NULL) {
dev_err(&pdev->dev, "unable to remap MMIO\n");
return -ENOMEM;
--
1.7.9.5


2013-04-01 06:42:41

by Anton Vorontsov

[permalink] [raw]
Subject: Re: [PATCH] drivers: power: goldfish: use resource_size()

On Sun, Mar 17, 2013 at 10:01:34AM +0200, Silviu-Mihai Popescu wrote:
> This uses the resource_size() function instead of explicit computation.
>
> Signed-off-by: Silviu-Mihai Popescu <[email protected]>
> ---

Applied, thanks!

Anton