Skip to contentSkip to conversation

mmc: host: use resource_size()

PATCH In review Silviu-Mihai Popescu 2 participants 2 messages Mar 12, 2013 – Mar 22, 2013 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: host: use resource_size()

Use resource_size() instead of explicit calculation. This was found via make coccicheck.

---
 drivers/mmc/host/android-goldfish.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/android-goldfish.c +1 -1
index ef3aef0..7780c14 100644
@@ -476,7 +476,7 @@ static int goldfish_mmc_probe(struct platform_device *pdev)
 	host->mmc = mmc;
 
 	pr_err("mmc: Mapping %lX to %lX\n", (long)res->start, (long)res->end);
-	host->reg_base = ioremap(res->start, res->end - res->start + 1);
+	host->reg_base = ioremap(res->start, resource_size(res));
 	if (host->reg_base == NULL) {
 		ret = -ENOMEM;
 		goto ioremap_failed;
Signature · 1 line
1.7.9.5
#1 lore raw

Hi,

Quoted 13 lines · Silviu-Mihai Popescu

Use resource_size() instead of explicit calculation. This was found via make coccicheck.

---
 drivers/mmc/host/android-goldfish.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/android-goldfish.c +0 -0
index ef3aef0..7780c14 100644

drivers/mmc/host/android-goldfish.c static int goldfish_mmc_probe(struct platform_device *pdev) · line 482

Quoted 8 lines
drivers/mmc/host/android-goldfish.c +1 -1
@@ -476,7 +476,7 @@ static int goldfish_mmc_probe(struct platform_device *pdev)
 	host->mmc = mmc;
 
 	pr_err("mmc: Mapping %lX to %lX\n", (long)res->start, (long)res->end);
-	host->reg_base = ioremap(res->start, res->end - res->start + 1);
+	host->reg_base = ioremap(res->start, resource_size(res));
 	if (host->reg_base == NULL) {
 		ret = -ENOMEM;
 		goto ioremap_failed;

Thanks, pushed to mmc-next for 3.10.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child