public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] hdpuftrs: use resource_size()
@ 2010-03-22 12:09 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-03-22 12:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors

The size caculation is wrong.  It should be end - start + 1.
Use resource_size() to calculate it correctly.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/misc/hdpuftrs/hdpu_nexus.c b/drivers/misc/hdpuftrs/hdpu_nexus.c
index ce39fa5..bce5029 100644
--- a/drivers/misc/hdpuftrs/hdpu_nexus.c
+++ b/drivers/misc/hdpuftrs/hdpu_nexus.c
@@ -92,8 +92,7 @@ static int hdpu_nexus_probe(struct platform_device *pdev)
 		       "Invalid memory resource.\n");
 		return -EINVAL;
 	}
-	nexus_id_addr = ioremap(res->start,
-				(unsigned long)(res->end - res->start));
+	nexus_id_addr = ioremap(res->start, resource_size(res));
 	if (nexus_id_addr) {
 		slot_id = (*nexus_id_addr >> 8) & 0x1f;
 		chassis_id = *nexus_id_addr & 0xff;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-22 12:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-22 12:09 [patch] hdpuftrs: use resource_size() Dan Carpenter

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