mtd: maps: add const qualifiers
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tue, 12 Mar 2013 08:46:37 +0000 (10:46 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 5 Apr 2013 12:04:20 +0000 (13:04 +0100)
Be a bit stricter and add few more 'const' qualifiers.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 files changed:
drivers/mtd/maps/bfin-async-flash.c
drivers/mtd/maps/dc21285.c
drivers/mtd/maps/gpio-addr-flash.c
drivers/mtd/maps/impa7.c
drivers/mtd/maps/intel_vr_nor.c
drivers/mtd/maps/ixp4xx.c
drivers/mtd/maps/lantiq-flash.c
drivers/mtd/maps/pci.c
drivers/mtd/maps/pxa2xx-flash.c
drivers/mtd/maps/rbtx4939-flash.c
drivers/mtd/maps/sa1100-flash.c
drivers/mtd/maps/solutionengine.c
drivers/mtd/maps/tsunami_flash.c

index f833edfaab79f7119f28a811ea6abd56318f90b3..319b04a6c9d1f6a0ccc5c565c977740d63babaa9 100644 (file)
@@ -122,7 +122,8 @@ static void bfin_flash_copy_to(struct map_info *map, unsigned long to, const voi
        switch_back(state);
 }
 
-static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
+static const char * const part_probe_types[] = {
+       "cmdlinepart", "RedBoot", NULL };
 
 static int bfin_flash_probe(struct platform_device *pdev)
 {
index 080f06053bd449d51467f3ab294acfe05289ed34..f8a7dd14cee0cc7a8b6767f0ef281ea95dd89149 100644 (file)
@@ -143,9 +143,8 @@ static struct map_info dc21285_map = {
        .copy_from = dc21285_copy_from,
 };
 
-
 /* Partition stuff */
-static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
+static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL };
 
 static int __init init_dc21285(void)
 {
index 7b643de2500b35cec6169169d9356592f97c637d..5ede28294f9e49765a9a24ed12867b94cc9e3208 100644 (file)
@@ -157,7 +157,8 @@ static void gf_copy_to(struct map_info *map, unsigned long to,
        memcpy_toio(map->virt + (to % state->win_size), from, len);
 }
 
-static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
+static const char * const part_probe_types[] = {
+       "cmdlinepart", "RedBoot", NULL };
 
 /**
  * gpio_flash_probe() - setup a mapping for a GPIO assisted flash
index 834a06c56f565ca466276474aebb2aea360fb97b..49686744d93cac9d2dae0758fd1b70618237c9c1 100644 (file)
 #define NUM_FLASHBANKS 2
 #define BUSWIDTH     4
 
-/* can be { "cfi_probe", "jedec_probe", "map_rom", NULL } */
-#define PROBETYPES { "jedec_probe", NULL }
-
 #define MSG_PREFIX "impA7:"   /* prefix for our printk()'s */
 #define MTDID      "impa7-%d"  /* for mtdparts= partitioning */
 
 static struct mtd_info *impa7_mtd[NUM_FLASHBANKS];
 
+static const char * const rom_probe_types[] = { "jedec_probe", NULL };
 
 static struct map_info impa7_map[NUM_FLASHBANKS] = {
        {
@@ -60,8 +58,7 @@ static struct mtd_partition partitions[] =
 
 static int __init init_impa7(void)
 {
-       static const char *rom_probe_types[] = PROBETYPES;
-       const char **type;
+       const char * const *type;
        int i;
        static struct { u_long addr; u_long size; } pt[NUM_FLASHBANKS] = {
          { WINDOW_ADDR0, WINDOW_SIZE0 },
index b14053b2502618e89fc7889ff385bc68db8f074d..f581ac1cf022fb006be3b814f6f1b23341f9e851 100644 (file)
@@ -82,9 +82,9 @@ static void vr_nor_destroy_mtd_setup(struct vr_nor_mtd *p)
 
 static int vr_nor_mtd_setup(struct vr_nor_mtd *p)
 {
-       static const char *probe_types[] =
+       static const char * const probe_types[] =
            { "cfi_probe", "jedec_probe", NULL };
-       const char **type;
+       const char * const *type;
 
        for (type = probe_types; !p->info && *type; type++)
                p->info = do_map_probe(*type, &p->map);
index e864fc6c58f9ccd900aad7284570ef70ab919220..52b3410a105c943d47ce3b9ea873781948d028a4 100644 (file)
@@ -148,7 +148,7 @@ struct ixp4xx_flash_info {
        struct resource *res;
 };
 
-static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
+static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL };
 
 static int ixp4xx_flash_remove(struct platform_device *dev)
 {
index d1da6ede3845bfdac001dffb036422d1107bdcd9..d7ac65d1d569dee08e325480501e29cc550ef012 100644 (file)
@@ -46,8 +46,7 @@ struct ltq_mtd {
 };
 
 static const char ltq_map_name[] = "ltq_nor";
-static const char *ltq_probe_types[] = {
-                                       "cmdlinepart", "ofpart", NULL };
+static const char * const ltq_probe_types[] = { "cmdlinepart", "ofpart", NULL };
 
 static map_word
 ltq_read16(struct map_info *map, unsigned long adr)
index c3aebd5da5d61046c9f9047148d3d7347a00ec2a..c2604f8b2a5efccd1cde4f77db2be09eb9ce1624 100644 (file)
@@ -283,8 +283,7 @@ static int mtd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
        if (err)
                goto release;
 
-       /* tsk - do_map_probe should take const char * */
-       mtd = do_map_probe((char *)info->map_name, &map->map);
+       mtd = do_map_probe(info->map_name, &map->map);
        err = -ENODEV;
        if (!mtd)
                goto release;
index 43e3dbb976d9937e0abf11ad8bab3b08da7f2a26..acb1dbcf7ce58a438ed7ff9a1df9aecb2b57478f 100644 (file)
@@ -45,9 +45,7 @@ struct pxa2xx_flash_info {
        struct map_info         map;
 };
 
-
-static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
-
+static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL };
 
 static int pxa2xx_flash_probe(struct platform_device *pdev)
 {
index 49c3fe715eee155cfc7519f5327e5f03640bd3be..ac02fbffd6df940f70e3802895811f5916843541 100644 (file)
@@ -45,14 +45,15 @@ static int rbtx4939_flash_remove(struct platform_device *dev)
        return 0;
 }
 
-static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL };
+static const char * const rom_probe_types[] = {
+       "cfi_probe", "jedec_probe", NULL };
 
 static int rbtx4939_flash_probe(struct platform_device *dev)
 {
        struct rbtx4939_flash_data *pdata;
        struct rbtx4939_flash_info *info;
        struct resource *res;
-       const char **probe_type;
+       const char * const *probe_type;
        int err = 0;
        unsigned long size;
 
index f694417cf7e694bc3e7f04edef6484ef03449e13..29e3dcaa1d90413b15df9e30c04373d897c2f6c6 100644 (file)
@@ -244,7 +244,7 @@ static struct sa_info *sa1100_setup_mtd(struct platform_device *pdev,
        return ERR_PTR(ret);
 }
 
-static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
+static const char * const part_probes[] = { "cmdlinepart", "RedBoot", NULL };
 
 static int sa1100_mtd_probe(struct platform_device *pdev)
 {
index 9d900ada67084535daa04aa5dd1effb7d9053857..83a7a70915624fbd5ba05a1eaca00a6cf2016d38 100644 (file)
@@ -31,7 +31,7 @@ struct map_info soleng_flash_map = {
        .bankwidth = 4,
 };
 
-static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
+static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL };
 
 #ifdef CONFIG_MTD_SUPERH_RESERVE
 static struct mtd_partition superh_se_partitions[] = {
index 1de390e1c2fb3039b98100014e21ac2e6563ba4c..da2cdb5fd6db98862dba7a0fe7c84ca6abd563af 100644 (file)
@@ -82,11 +82,12 @@ static void __exit  cleanup_tsunami_flash(void)
        tsunami_flash_mtd = 0;
 }
 
+static const char * const rom_probe_types[] = {
+       "cfi_probe", "jedec_probe", "map_rom", NULL };
 
 static int __init init_tsunami_flash(void)
 {
-       static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", NULL };
-       char **type;
+       const char * const *type;
 
        tsunami_tig_writeb(FLASH_ENABLE_BYTE, FLASH_ENABLE_PORT);