public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] power: resource_size() instead of computation
@ 2013-03-27 21:53 Andrei Epure
  2013-04-01  6:41 ` Anton Vorontsov
  0 siblings, 1 reply; 2+ messages in thread
From: Andrei Epure @ 2013-03-27 21:53 UTC (permalink / raw)
  To: cbou, dwmw2; +Cc: linux-kernel, Andrei Epure

Patch found using coccinelle.

Signed-off-by: Andrei Epure <epure.andrei@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-01  6:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-27 21:53 [PATCH] power: resource_size() instead of computation Andrei Epure
2013-04-01  6:41 ` Anton Vorontsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox