]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] mtd/maps trivial annotations
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Sat, 27 Nov 2004 13:57:39 +0000 (05:57 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 27 Nov 2004 13:57:39 +0000 (05:57 -0800)
NULL noise removal, missing __iomem in a couple of declarations, removal
of bogus cast to void * in iounmap() calls.

Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 files changed:
drivers/mtd/maps/amd76xrom.c
drivers/mtd/maps/dilnetpc.c
drivers/mtd/maps/ebony.c
drivers/mtd/maps/elan-104nc.c
drivers/mtd/maps/ichxrom.c
drivers/mtd/maps/l440gx.c
drivers/mtd/maps/netsc520.c
drivers/mtd/maps/nettel.c
drivers/mtd/maps/pci.c
drivers/mtd/maps/physmap.c
drivers/mtd/maps/sbc_gxx.c
drivers/mtd/maps/sc520cdp.c
drivers/mtd/maps/scb2_flash.c
drivers/mtd/maps/scx200_docflash.c
drivers/mtd/maps/ts5500_flash.c

index 5d732c4b21fa07d9ca36eda2b0bd7be334c8e926..baf028c9c7b77b1c96558d64953e0e2e6909afbe 100644 (file)
@@ -89,7 +89,7 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev,
        static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL };
        u8 byte;
        struct amd76xrom_window *window = &amd76xrom_window;
-       struct amd76xrom_map_info *map = 0;
+       struct amd76xrom_map_info *map = NULL;
        unsigned long map_top;
 
        /* Remember the pci dev I find the window in */
@@ -244,7 +244,7 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev,
                map->mtd->owner = THIS_MODULE;
                if (add_mtd_device(map->mtd)) {
                        map_destroy(map->mtd);
-                       map->mtd = 0;
+                       map->mtd = NULL;
                        goto out;
                }
 
@@ -254,7 +254,7 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev,
 
                /* File away the map structure */
                list_add(&map->list, &window->maps);
-               map = 0;
+               map = NULL;
        }
 
  out:
index b7bbd39653756b2d6c2e03dfc1355fc52b27fb5a..69d0e7ceb5ec8ffdaa30c71eb69e5ef0c852ca22 100644 (file)
@@ -430,7 +430,7 @@ static int __init init_dnpc(void)
                        mymtd->erasesize = 0x10000;
 
        if (!mymtd) {
-               iounmap((void *)dnpc_map.virt);
+               iounmap(dnpc_map.virt);
                return -ENXIO;
        }
                
@@ -481,9 +481,9 @@ static void __exit cleanup_dnpc(void)
                map_destroy(mymtd);
        }
        if (dnpc_map.virt) {
-               iounmap((void *)dnpc_map.virt);
+               iounmap(dnpc_map.virt);
                dnpc_unmap_flash();
-               dnpc_map.virt = 0;
+               dnpc_map.virt = NULL;
        }
 }
 
index 387af503e0c3eb4e3baf8e99d657e035978f1009..b654c316ccd0eabb71e309d735c3238ae0c7e5bb 100644 (file)
@@ -64,7 +64,7 @@ static struct mtd_partition ebony_large_partitions[] = {
 int __init init_ebony(void)
 {
        u8 fpga0_reg;
-       u8 *fpga0_adr;
+       u8 __iomem *fpga0_adr;
        unsigned long long small_flash_base, large_flash_base;
 
        fpga0_adr = ioremap64(EBONY_FPGA_ADDR, 16);
@@ -114,8 +114,7 @@ int __init init_ebony(void)
        }
 
        ebony_large_map.phys = large_flash_base;
-       ebony_large_map.virt =
-               (unsigned long)ioremap64(large_flash_base,
+       ebony_large_map.virt = ioremap64(large_flash_base,
                                         ebony_large_map.size);
 
        if (!ebony_large_map.virt) {
@@ -146,13 +145,13 @@ static void __exit cleanup_ebony(void)
        }
 
        if (ebony_small_map.virt) {
-               iounmap((void *)ebony_small_map.virt);
-               ebony_small_map.virt = 0;
+               iounmap(ebony_small_map.virt);
+               ebony_small_map.virt = NULL;
        }
 
        if (ebony_large_map.virt) {
-               iounmap((void *)ebony_large_map.virt);
-               ebony_large_map.virt = 0;
+               iounmap(ebony_large_map.virt);
+               ebony_large_map.virt = NULL;
        }
 }
 
index d77dfbdf440a33c5b3bd5a98c11aec23b81f5c1b..f36bddc65bb7df2b690af4d76834b575bf135b1a 100644 (file)
@@ -182,7 +182,7 @@ static void cleanup_elan_104nc(void)
                map_destroy( all_mtd );
        }
 
-       iounmap((void *)iomapadr);
+       iounmap(iomapadr);
 }
 
 static int __init init_elan_104nc(void)
index 0e105f7720eb303641844182ac95a9ca76c96793..9a8890d7f1df6c33d6f81672e8577be71d02c305 100644 (file)
@@ -89,7 +89,7 @@ static int __devinit ichxrom_init_one (struct pci_dev *pdev,
 {
        static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL };
        struct ichxrom_window *window = &ichxrom_window;
-       struct ichxrom_map_info *map = 0;
+       struct ichxrom_map_info *map = NULL;
        unsigned long map_top;
        u8 byte;
        u16 word;
@@ -291,7 +291,7 @@ static int __devinit ichxrom_init_one (struct pci_dev *pdev,
                map->mtd->owner = THIS_MODULE;
                if (add_mtd_device(map->mtd)) {
                        map_destroy(map->mtd);
-                       map->mtd = 0;
+                       map->mtd = NULL;
                        goto out;
                }
 
@@ -301,7 +301,7 @@ static int __devinit ichxrom_init_one (struct pci_dev *pdev,
 
                /* File away the map structure */
                list_add(&map->list, &window->maps);
-               map = 0;
+               map = NULL;
        }
 
  out:
index b5b468a85797f59d4f76c9554195df23e4821534..620ef1c381b9ca6ac96a562c7db67d4d22676947 100644 (file)
@@ -103,7 +103,7 @@ static int __init init_l440gx(void)
                /* Allocate the resource region */
                if (pci_assign_resource(pm_dev, PIIXE_IOBASE_RESOURCE) != 0) {
                        printk(KERN_WARNING "Could not allocate pm iobase resource\n");
-                       iounmap((void *)l440gx_map.virt);
+                       iounmap(l440gx_map.virt);
                        return -ENXIO;
                }
        }
@@ -137,7 +137,7 @@ static int __init init_l440gx(void)
                return 0;
        }
 
-       iounmap((void *)l440gx_map.virt);
+       iounmap(l440gx_map.virt);
        return -ENXIO;
 }
 
@@ -146,7 +146,7 @@ static void __exit cleanup_l440gx(void)
        del_mtd_device(mymtd);
        map_destroy(mymtd);
        
-       iounmap((void *)l440gx_map.virt);
+       iounmap(l440gx_map.virt);
 }
 
 module_init(init_l440gx);
index f7319853243088181750ac03ac98bdf1ff0fa21e..0c7799f7fb9696bdfac519ac1edda9eec3aef272 100644 (file)
@@ -111,7 +111,7 @@ static int __init init_netsc520(void)
                mymtd = do_map_probe("map_rom", &netsc520_map);
 
        if (!mymtd) {
-               iounmap((void *)netsc520_map.virt);
+               iounmap(netsc520_map.virt);
                return -ENXIO;
        }
                
@@ -127,8 +127,8 @@ static void __exit cleanup_netsc520(void)
                map_destroy(mymtd);
        }
        if (netsc520_map.virt) {
-               iounmap((void *)netsc520_map.virt);
-               netsc520_map.virt = 0;
+               iounmap(netsc520_map.virt);
+               netsc520_map.virt = NULL;
        }
 }
 
index df1d4e022371c364b4cdfefeec72ac1841675c34..a6014b66b2fce9f11b1409a86c5ab10036ec56a9 100644 (file)
@@ -471,8 +471,8 @@ void __exit nettel_cleanup(void)
                map_destroy(amd_mtd);
        }
        if (nettel_amd_map.virt) {
-               iounmap((void *)nettel_amd_map.virt);
-               nettel_amd_map.virt = 0;
+               iounmap(nettel_amd_map.virt);
+               nettel_amd_map.virt = NULL;
        }
 #ifdef CONFIG_MTD_CFI_INTELEXT
        if (intel_mtd) {
index 8b5d1ff45755995733df6f9ef039edfa3c5fae52..fa29999fb410fade38c320c214e71f14840f116f 100644 (file)
@@ -33,7 +33,7 @@ struct mtd_pci_info {
 
 struct map_pci_info {
        struct map_info map;
-       void *base;
+       void __iomem *base;
        void (*exit)(struct pci_dev *dev, struct map_pci_info *map);
        unsigned long (*translate)(struct map_pci_info *map, unsigned long ofs);
        struct pci_dev *dev;
@@ -143,7 +143,7 @@ static void
 intel_iq80310_exit(struct pci_dev *dev, struct map_pci_info *map)
 {
        if (map->base)
-               iounmap((void *)map->base);
+               iounmap(map->base);
        pci_write_config_dword(dev, 0x44, map->map.map_priv_2);
 }
 
@@ -236,7 +236,7 @@ intel_dc21285_exit(struct pci_dev *dev, struct map_pci_info *map)
        u32 val;
 
        if (map->base)
-               iounmap((void *)map->base);
+               iounmap(map->base);
 
        /*
         * We need to undo the PCI BAR2/PCI ROM BAR address alteration.
index b7d91f06a011a8bf12bcde9cc5482f9e3a8bdb5f..0b605af8bd82cc94b00cd9143da25860ac34fb80 100644 (file)
@@ -92,7 +92,7 @@ static int __init init_physmap(void)
                return 0;
        }
 
-       iounmap((void *)physmap_map.virt);
+       iounmap(physmap_map.virt);
        return -ENXIO;
 }
 
@@ -112,8 +112,8 @@ static void __exit cleanup_physmap(void)
 #endif
        map_destroy(mymtd);
 
-       iounmap((void *)physmap_map.virt);
-       physmap_map.virt = 0;
+       iounmap(physmap_map.virt);
+       physmap_map.virt = NULL;
 }
 
 module_init(init_physmap);
index e5b1c206641939a9250e898bec80b3b07b20db0b..176602839fe9b3cdac96626d253ca2a07195d933 100644 (file)
@@ -189,7 +189,7 @@ static void cleanup_sbc_gxx(void)
                map_destroy( all_mtd );
        }
 
-       iounmap((void *)iomapadr);
+       iounmap(iomapadr);
        release_region(PAGE_IO,PAGE_IO_SIZE);
 }
 
@@ -206,7 +206,7 @@ static int __init init_sbc_gxx(void)
                printk( KERN_ERR"%s: IO ports 0x%x-0x%x in use\n",
                        sbc_gxx_map.name,
                        PAGE_IO, PAGE_IO+PAGE_IO_SIZE-1 );
-               iounmap((void *)iomapadr);
+               iounmap(iomapadr);
                return -EAGAIN;
        }
                
index 7804011a467a66aca90d737fd002ece7d4a9c227..fc5a5553a060ef073135d311a8fcdb465915278c 100644 (file)
@@ -186,12 +186,12 @@ static struct sc520_par_table par_table[NUM_FLASH_BANKS] =
 
 static void sc520cdp_setup_par(void)
 {
-       volatile unsigned long *mmcr;
+       volatile unsigned long __iomem *mmcr;
        unsigned long mmcr_val;
        int i, j;
 
        /* map in SC520's MMCR area */
-       mmcr = (unsigned long *)ioremap_nocache(SC520_MMCR_BASE, SC520_MMCR_EXTENT);
+       mmcr = ioremap_nocache(SC520_MMCR_BASE, SC520_MMCR_EXTENT);
        if(!mmcr) { /* ioremap_nocache failed: skip the PAR reprogramming */
                /* force physical address fields to BIOS defaults: */
                for(i = 0; i < NUM_FLASH_BANKS; i++)
@@ -223,7 +223,7 @@ static void sc520cdp_setup_par(void)
                        sc520cdp_map[i].phys = par_table[i].default_address;
                }
        }
-       iounmap((void *)mmcr);
+       iounmap(mmcr);
 }
 #endif
 
@@ -261,7 +261,7 @@ static int __init init_sc520cdp(void)
                        ++devices_found;
                }
                else {
-                       iounmap((void *)sc520cdp_map[i].virt);
+                       iounmap(sc520cdp_map[i].virt);
                }
        }
        if(devices_found >= 2) {
@@ -290,8 +290,8 @@ static void __exit cleanup_sc520cdp(void)
                if (mymtd[i])
                        map_destroy(mymtd[i]);
                if (sc520cdp_map[i].virt) {
-                       iounmap((void *)sc520cdp_map[i].virt);
-                       sc520cdp_map[i].virt = 0;
+                       iounmap(sc520cdp_map[i].virt);
+                       sc520cdp_map[i].virt = NULL;
                }
        }
 }
index 7231cafe7872a926976a873d396aa126e68916cc..1854cd3a43fbcbfa9505f5663d89be3c917946fd 100644 (file)
@@ -62,7 +62,7 @@
 #define SCB2_WINDOW    0x00100000
 
 
-static void *scb2_ioaddr;
+static void __iomem *scb2_ioaddr;
 static struct mtd_info *scb2_mtd;
 static struct map_info scb2_map = {
        .name =      "SCB2 BIOS Flash",
@@ -163,7 +163,7 @@ scb2_flash_probe(struct pci_dev *dev, const struct pci_device_id *ent)
        }
 
        scb2_map.phys = SCB2_ADDR;
-       scb2_map.virt = (void __iomem *)scb2_ioaddr;
+       scb2_map.virt = scb2_ioaddr;
        scb2_map.size = SCB2_WINDOW;
 
        simple_map_init(&scb2_map);
index 9b106315905e20d5dfc271de49e5187ac6f82a3b..d07ddf6607892a7155e55d1276e3bba058c998f1 100644 (file)
@@ -190,7 +190,7 @@ static int __init init_scx200_docflash(void)
        mymtd = do_map_probe(flashtype, &scx200_docflash_map);
        if (!mymtd) {
                printk(KERN_ERR NAME ": unable to detect flash\n");
-               iounmap((void *)scx200_docflash_map.virt);
+               iounmap(scx200_docflash_map.virt);
                release_resource(&docmem);
                return -ENXIO;
        }
@@ -221,7 +221,7 @@ static void __exit cleanup_scx200_docflash(void)
                map_destroy(mymtd);
        }
        if (scx200_docflash_map.virt) {
-               iounmap((void *)scx200_docflash_map.virt);
+               iounmap(scx200_docflash_map.virt);
                release_resource(&docmem);
        }
 }
index 14c678e6dd6d7c59f4916570b6394deafabca929..f90998b279792ade16aa1bea33a78de10c9e216d 100644 (file)
@@ -79,7 +79,7 @@ static int __init init_ts5500_map(void)
 {
        int rc = 0;
 
-       ts5500_map.virt = (void*)ioremap_nocache(ts5500_map.phys, ts5500_map.size);
+       ts5500_map.virt = ioremap_nocache(ts5500_map.phys, ts5500_map.size);
 
        if(!ts5500_map.virt) {
                printk(KERN_ERR "Failed to ioremap_nocache\n");
@@ -110,7 +110,7 @@ static int __init init_ts5500_map(void)
 err_out_map:
        map_destroy(mymtd);
 err_out_ioremap:
-       iounmap((void *)ts5500_map.virt);
+       iounmap(ts5500_map.virt);
 
        return rc;
 }
@@ -127,8 +127,8 @@ static void __exit cleanup_ts5500_map(void)
        }
 
        if (ts5500_map.virt) {
-               iounmap((void *)ts5500_map.virt);
-               ts5500_map.virt = 0;
+               iounmap(ts5500_map.virt);
+               ts5500_map.virt = NULL;
        }
 }