Commit 7865f699 authored by Jesper Juhl's avatar Jesper Juhl Committed by David Woodhouse

[MTD] remove unnecessary 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: default avatarJesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent 75315d1c
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* (C) Copyright 2000-2001, Greg Ungerer (gerg@snapgear.com) * (C) Copyright 2000-2001, Greg Ungerer (gerg@snapgear.com)
* (C) Copyright 2001-2002, SnapGear (www.snapgear.com) * (C) Copyright 2001-2002, SnapGear (www.snapgear.com)
* *
* $Id: nettel.c,v 1.9 2004/11/28 09:40:40 dwmw2 Exp $ * $Id: nettel.c,v 1.10 2005/01/05 17:11:29 dwmw2 Exp $
*/ */
/****************************************************************************/ /****************************************************************************/
...@@ -332,8 +332,8 @@ int __init nettel_init(void) ...@@ -332,8 +332,8 @@ int __init nettel_init(void)
/* Destroy useless AMD MTD mapping */ /* Destroy useless AMD MTD mapping */
amd_mtd = NULL; amd_mtd = NULL;
iounmap((void *) nettel_amd_map.virt); iounmap(nettel_amd_map.virt);
nettel_amd_map.virt = (unsigned long) NULL; nettel_amd_map.virt = NULL;
#else #else
/* Only AMD flash supported */ /* Only AMD flash supported */
return(-ENXIO); return(-ENXIO);
...@@ -357,8 +357,7 @@ int __init nettel_init(void) ...@@ -357,8 +357,7 @@ int __init nettel_init(void)
/* Probe for the the size of the first Intel flash */ /* Probe for the the size of the first Intel flash */
nettel_intel_map.size = maxsize; nettel_intel_map.size = maxsize;
nettel_intel_map.phys = intel0addr; nettel_intel_map.phys = intel0addr;
nettel_intel_map.virt = (unsigned long) nettel_intel_map.virt = ioremap_nocache(intel0addr, maxsize);
ioremap_nocache(intel0addr, maxsize);
if (!nettel_intel_map.virt) { if (!nettel_intel_map.virt) {
printk("SNAPGEAR: failed to ioremap() ROMCS1\n"); printk("SNAPGEAR: failed to ioremap() ROMCS1\n");
return(-EIO); return(-EIO);
...@@ -366,8 +365,8 @@ int __init nettel_init(void) ...@@ -366,8 +365,8 @@ int __init nettel_init(void)
simple_map_init(&nettel_intel_map); simple_map_init(&nettel_intel_map);
intel_mtd = do_map_probe("cfi_probe", &nettel_intel_map); intel_mtd = do_map_probe("cfi_probe", &nettel_intel_map);
if (! intel_mtd) { if (!intel_mtd) {
iounmap((void *) nettel_intel_map.virt); iounmap(nettel_intel_map.virt);
return(-ENXIO); return(-ENXIO);
} }
...@@ -388,11 +387,10 @@ int __init nettel_init(void) ...@@ -388,11 +387,10 @@ int __init nettel_init(void)
/* Delete the old map and probe again to do both chips */ /* Delete the old map and probe again to do both chips */
map_destroy(intel_mtd); map_destroy(intel_mtd);
intel_mtd = NULL; intel_mtd = NULL;
iounmap((void *) nettel_intel_map.virt); iounmap(nettel_intel_map.virt);
nettel_intel_map.size = maxsize; nettel_intel_map.size = maxsize;
nettel_intel_map.virt = (unsigned long) nettel_intel_map.virt = ioremap_nocache(intel0addr, maxsize);
ioremap_nocache(intel0addr, maxsize);
if (!nettel_intel_map.virt) { if (!nettel_intel_map.virt) {
printk("SNAPGEAR: failed to ioremap() ROMCS1/2\n"); printk("SNAPGEAR: failed to ioremap() ROMCS1/2\n");
return(-EIO); return(-EIO);
...@@ -480,7 +478,7 @@ void __exit nettel_cleanup(void) ...@@ -480,7 +478,7 @@ void __exit nettel_cleanup(void)
map_destroy(intel_mtd); map_destroy(intel_mtd);
} }
if (nettel_intel_map.virt) { if (nettel_intel_map.virt) {
iounmap((void *)nettel_intel_map.virt); iounmap(nettel_intel_map.virt);
nettel_intel_map.virt = 0; nettel_intel_map.virt = 0;
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment