Skip to contentSkip to conversation

hdpuftrs: use resource_size()

PATCH New Dan Carpenter 1 participant 1 message Mar 22, 2010 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hdpuftrs: use resource_size()

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

drivers/misc/hdpuftrs/hdpu_nexus.c +1 -2
index ce39fa5..bce5029 100644
@@ -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;