mtd/drivers/mtd/maps nettel.c,1.9,1.10

David Woodhouse dwmw2 at infradead.org
Wed Jan 5 12:11:32 EST 2005


Update of /home/cvs/mtd/drivers/mtd/maps
In directory phoenix.infradead.org:/tmp/cvs-serv1240

Modified Files:
	nettel.c 
Log Message:
[patch] remove unnessesary casts from drivers/mtd/maps/nettel.c and kill two warnings

I took a look at the cause for these warnings in the 2.6.10 kernel,

drivers/mtd/maps/nettel.c:361: warning: assignment makes pointer from integer without a cast
drivers/mtd/maps/nettel.c:395: warning: assignment makes pointer from integer without a cast

and as far as I can see the casts in there (to unsigned long and back to 
void*) are completely unnessesary ('virt' in 'struct map_info' is a void 
__iomem *), and getting rid of those casts buys us a warning free build.

Signed-off-by: Jesper Juhl <juhl-lkml at dif.dk>


Index: nettel.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/nettel.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- nettel.c	28 Nov 2004 09:40:40 -0000	1.9
+++ nettel.c	5 Jan 2005 17:11:29 -0000	1.10
@@ -332,8 +332,8 @@
 
 		/* Destroy useless AMD MTD mapping */
 		amd_mtd = NULL;
-		iounmap((void *) nettel_amd_map.virt);
-		nettel_amd_map.virt = (unsigned long) NULL;
+		iounmap(nettel_amd_map.virt);
+		nettel_amd_map.virt = NULL;
 #else
 		/* Only AMD flash supported */
 		return(-ENXIO);
@@ -357,8 +357,7 @@
 	/* Probe for the the size of the first Intel flash */
 	nettel_intel_map.size = maxsize;
 	nettel_intel_map.phys = intel0addr;
-	nettel_intel_map.virt = (unsigned long)
-		ioremap_nocache(intel0addr, maxsize);
+	nettel_intel_map.virt = ioremap_nocache(intel0addr, maxsize);
 	if (!nettel_intel_map.virt) {
 		printk("SNAPGEAR: failed to ioremap() ROMCS1\n");
 		return(-EIO);
@@ -366,8 +365,8 @@
 	simple_map_init(&nettel_intel_map);
 
 	intel_mtd = do_map_probe("cfi_probe", &nettel_intel_map);
-	if (! intel_mtd) {
-		iounmap((void *) nettel_intel_map.virt);
+	if (!intel_mtd) {
+		iounmap(nettel_intel_map.virt);
 		return(-ENXIO);
 	}
 
@@ -388,11 +387,10 @@
 	/* Delete the old map and probe again to do both chips */
 	map_destroy(intel_mtd);
 	intel_mtd = NULL;
-	iounmap((void *) nettel_intel_map.virt);
+	iounmap(nettel_intel_map.virt);
 
 	nettel_intel_map.size = maxsize;
-	nettel_intel_map.virt = (unsigned long)
-		ioremap_nocache(intel0addr, maxsize);
+	nettel_intel_map.virt = ioremap_nocache(intel0addr, maxsize);
 	if (!nettel_intel_map.virt) {
 		printk("SNAPGEAR: failed to ioremap() ROMCS1/2\n");
 		return(-EIO);
@@ -480,7 +478,7 @@
 		map_destroy(intel_mtd);
 	}
 	if (nettel_intel_map.virt) {
-		iounmap((void *)nettel_intel_map.virt);
+		iounmap(nettel_intel_map.virt);
 		nettel_intel_map.virt = 0;
 	}
 #endif





More information about the linux-mtd-cvs mailing list