Skip to contentSkip to conversation

hw_random: timeriomem-rng: use resource_size

PATCH In review H Hartley Sweeten 3 participants 3 messages Jun 1, 2011 – Jun 8, 2011 Hardware random number generator core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw_random: timeriomem-rng: use resource_size

---

drivers/char/hw_random/timeriomem-rng.c +1 -2
index a94e930..a8428e6 100644
@@ -100,8 +100,7 @@ static int __devinit timeriomem_rng_probe(struct platform_device *pdev)
 
 	timeriomem_rng_data = pdev->dev.platform_data;
 
-	timeriomem_rng_data->address = ioremap(res->start,
-						res->end - res->start + 1);
+	timeriomem_rng_data->address = ioremap(res->start, resource_size(res));
 	if (!timeriomem_rng_data->address)
 		return -EIO;
 
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · H Hartley Sweeten

Looks good to me.

Quoted 16 lines

---

drivers/char/hw_random/timeriomem-rng.c +1 -2
index a94e930..a8428e6 100644
@@ -100,8 +100,7 @@ static int __devinit timeriomem_rng_probe(struct platform_device *pdev)
 
 	timeriomem_rng_data = pdev->dev.platform_data;
 
-	timeriomem_rng_data->address = ioremap(res->start,
-						res->end - res->start + 1);
+	timeriomem_rng_data->address = ioremap(res->start, resource_size(res));
 	if (!timeriomem_rng_data->address)
 		return -EIO;
 
Signature · 1 line
Mathematics is the supreme nostalgia of our time.