Commit 0984c8910426371205da0b60fc1dae64a996fb64
Committed by
David Woodhouse
1 parent
cce2a026b5
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
mtd: maps: add const qualifiers
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>
Showing 13 changed files with 21 additions and 25 deletions Side-by-side Diff
- 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
drivers/mtd/maps/bfin-async-flash.c
... | ... | @@ -122,7 +122,8 @@ |
122 | 122 | switch_back(state); |
123 | 123 | } |
124 | 124 | |
125 | -static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL }; | |
125 | +static const char * const part_probe_types[] = { | |
126 | + "cmdlinepart", "RedBoot", NULL }; | |
126 | 127 | |
127 | 128 | static int bfin_flash_probe(struct platform_device *pdev) |
128 | 129 | { |
drivers/mtd/maps/dc21285.c
... | ... | @@ -143,9 +143,8 @@ |
143 | 143 | .copy_from = dc21285_copy_from, |
144 | 144 | }; |
145 | 145 | |
146 | - | |
147 | 146 | /* Partition stuff */ |
148 | -static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; | |
147 | +static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL }; | |
149 | 148 | |
150 | 149 | static int __init init_dc21285(void) |
151 | 150 | { |
drivers/mtd/maps/gpio-addr-flash.c
... | ... | @@ -157,7 +157,8 @@ |
157 | 157 | memcpy_toio(map->virt + (to % state->win_size), from, len); |
158 | 158 | } |
159 | 159 | |
160 | -static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL }; | |
160 | +static const char * const part_probe_types[] = { | |
161 | + "cmdlinepart", "RedBoot", NULL }; | |
161 | 162 | |
162 | 163 | /** |
163 | 164 | * gpio_flash_probe() - setup a mapping for a GPIO assisted flash |
drivers/mtd/maps/impa7.c
... | ... | @@ -24,14 +24,12 @@ |
24 | 24 | #define NUM_FLASHBANKS 2 |
25 | 25 | #define BUSWIDTH 4 |
26 | 26 | |
27 | -/* can be { "cfi_probe", "jedec_probe", "map_rom", NULL } */ | |
28 | -#define PROBETYPES { "jedec_probe", NULL } | |
29 | - | |
30 | 27 | #define MSG_PREFIX "impA7:" /* prefix for our printk()'s */ |
31 | 28 | #define MTDID "impa7-%d" /* for mtdparts= partitioning */ |
32 | 29 | |
33 | 30 | static struct mtd_info *impa7_mtd[NUM_FLASHBANKS]; |
34 | 31 | |
32 | +static const char * const rom_probe_types[] = { "jedec_probe", NULL }; | |
35 | 33 | |
36 | 34 | static struct map_info impa7_map[NUM_FLASHBANKS] = { |
37 | 35 | { |
... | ... | @@ -60,8 +58,7 @@ |
60 | 58 | |
61 | 59 | static int __init init_impa7(void) |
62 | 60 | { |
63 | - static const char *rom_probe_types[] = PROBETYPES; | |
64 | - const char **type; | |
61 | + const char * const *type; | |
65 | 62 | int i; |
66 | 63 | static struct { u_long addr; u_long size; } pt[NUM_FLASHBANKS] = { |
67 | 64 | { WINDOW_ADDR0, WINDOW_SIZE0 }, |
drivers/mtd/maps/intel_vr_nor.c
... | ... | @@ -82,9 +82,9 @@ |
82 | 82 | |
83 | 83 | static int vr_nor_mtd_setup(struct vr_nor_mtd *p) |
84 | 84 | { |
85 | - static const char *probe_types[] = | |
85 | + static const char * const probe_types[] = | |
86 | 86 | { "cfi_probe", "jedec_probe", NULL }; |
87 | - const char **type; | |
87 | + const char * const *type; | |
88 | 88 | |
89 | 89 | for (type = probe_types; !p->info && *type; type++) |
90 | 90 | p->info = do_map_probe(*type, &p->map); |
drivers/mtd/maps/ixp4xx.c
... | ... | @@ -148,7 +148,7 @@ |
148 | 148 | struct resource *res; |
149 | 149 | }; |
150 | 150 | |
151 | -static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; | |
151 | +static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL }; | |
152 | 152 | |
153 | 153 | static int ixp4xx_flash_remove(struct platform_device *dev) |
154 | 154 | { |
drivers/mtd/maps/lantiq-flash.c
... | ... | @@ -46,8 +46,7 @@ |
46 | 46 | }; |
47 | 47 | |
48 | 48 | static const char ltq_map_name[] = "ltq_nor"; |
49 | -static const char *ltq_probe_types[] = { | |
50 | - "cmdlinepart", "ofpart", NULL }; | |
49 | +static const char * const ltq_probe_types[] = { "cmdlinepart", "ofpart", NULL }; | |
51 | 50 | |
52 | 51 | static map_word |
53 | 52 | ltq_read16(struct map_info *map, unsigned long adr) |
drivers/mtd/maps/pci.c
... | ... | @@ -283,8 +283,7 @@ |
283 | 283 | if (err) |
284 | 284 | goto release; |
285 | 285 | |
286 | - /* tsk - do_map_probe should take const char * */ | |
287 | - mtd = do_map_probe((char *)info->map_name, &map->map); | |
286 | + mtd = do_map_probe(info->map_name, &map->map); | |
288 | 287 | err = -ENODEV; |
289 | 288 | if (!mtd) |
290 | 289 | goto release; |
drivers/mtd/maps/pxa2xx-flash.c
... | ... | @@ -45,9 +45,7 @@ |
45 | 45 | struct map_info map; |
46 | 46 | }; |
47 | 47 | |
48 | - | |
49 | -static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; | |
50 | - | |
48 | +static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL }; | |
51 | 49 | |
52 | 50 | static int pxa2xx_flash_probe(struct platform_device *pdev) |
53 | 51 | { |
drivers/mtd/maps/rbtx4939-flash.c
... | ... | @@ -45,14 +45,15 @@ |
45 | 45 | return 0; |
46 | 46 | } |
47 | 47 | |
48 | -static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL }; | |
48 | +static const char * const rom_probe_types[] = { | |
49 | + "cfi_probe", "jedec_probe", NULL }; | |
49 | 50 | |
50 | 51 | static int rbtx4939_flash_probe(struct platform_device *dev) |
51 | 52 | { |
52 | 53 | struct rbtx4939_flash_data *pdata; |
53 | 54 | struct rbtx4939_flash_info *info; |
54 | 55 | struct resource *res; |
55 | - const char **probe_type; | |
56 | + const char * const *probe_type; | |
56 | 57 | int err = 0; |
57 | 58 | unsigned long size; |
58 | 59 |
drivers/mtd/maps/sa1100-flash.c
... | ... | @@ -244,7 +244,7 @@ |
244 | 244 | return ERR_PTR(ret); |
245 | 245 | } |
246 | 246 | |
247 | -static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL }; | |
247 | +static const char * const part_probes[] = { "cmdlinepart", "RedBoot", NULL }; | |
248 | 248 | |
249 | 249 | static int sa1100_mtd_probe(struct platform_device *pdev) |
250 | 250 | { |
drivers/mtd/maps/solutionengine.c
... | ... | @@ -31,7 +31,7 @@ |
31 | 31 | .bankwidth = 4, |
32 | 32 | }; |
33 | 33 | |
34 | -static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; | |
34 | +static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL }; | |
35 | 35 | |
36 | 36 | #ifdef CONFIG_MTD_SUPERH_RESERVE |
37 | 37 | static struct mtd_partition superh_se_partitions[] = { |
drivers/mtd/maps/tsunami_flash.c
... | ... | @@ -82,11 +82,12 @@ |
82 | 82 | tsunami_flash_mtd = 0; |
83 | 83 | } |
84 | 84 | |
85 | +static const char * const rom_probe_types[] = { | |
86 | + "cfi_probe", "jedec_probe", "map_rom", NULL }; | |
85 | 87 | |
86 | 88 | static int __init init_tsunami_flash(void) |
87 | 89 | { |
88 | - static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", NULL }; | |
89 | - char **type; | |
90 | + const char * const *type; | |
90 | 91 | |
91 | 92 | tsunami_tig_writeb(FLASH_ENABLE_BYTE, FLASH_ENABLE_PORT); |
92 | 93 |