diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2015-02-18 15:01:45 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2015-02-19 03:44:17 -0500 |
commit | 543c5040f564c80fe59ae82a60fc061055d04a41 (patch) | |
tree | 40f47351a06a1d8e54f0956803e58cdcfe09bb8a | |
parent | d88d6cfc912e9e54f9ec0337a84691436c654077 (diff) |
ARM: make arrays containing machine compatible strings const
The definition
static const char *axxia_dt_match[] __initconst = {
...
defines a changable array of constant strings. That is you must not do:
*axxia_dt_match[0] = 'k';
but
axxia_dt_match[0] = "different string";
is fine. So the annotation __initconst is wrong and yields a compiler
error when other really const variables are added with __initconst.
As the struct machine_desc member dt_compat is declared as
const char *const *dt_compat;
making the arrays const is the better alternative over changing all
annotations to __initdata.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | arch/arm/mach-axxia/axxia.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-bcm/brcmstb.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos/exynos.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-highbank/highbank.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-hisi/hisilicon.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-keystone/keystone.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-nspire/nspire.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-prima2/common.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/s5pv210.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-emev2.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-versatile/versatile_dt.c | 2 |
11 files changed, 16 insertions, 16 deletions
diff --git a/arch/arm/mach-axxia/axxia.c b/arch/arm/mach-axxia/axxia.c index 19e5a1d95397..4db76a493c5a 100644 --- a/arch/arm/mach-axxia/axxia.c +++ b/arch/arm/mach-axxia/axxia.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <asm/mach/arch.h> | 17 | #include <asm/mach/arch.h> |
18 | 18 | ||
19 | static const char *axxia_dt_match[] __initconst = { | 19 | static const char *const axxia_dt_match[] __initconst = { |
20 | "lsi,axm5516", | 20 | "lsi,axm5516", |
21 | "lsi,axm5516-sim", | 21 | "lsi,axm5516-sim", |
22 | "lsi,axm5516-emu", | 22 | "lsi,axm5516-emu", |
diff --git a/arch/arm/mach-bcm/brcmstb.c b/arch/arm/mach-bcm/brcmstb.c index 60a5afa06ed7..3a60f7ee3f0c 100644 --- a/arch/arm/mach-bcm/brcmstb.c +++ b/arch/arm/mach-bcm/brcmstb.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <asm/mach-types.h> | 17 | #include <asm/mach-types.h> |
18 | #include <asm/mach/arch.h> | 18 | #include <asm/mach/arch.h> |
19 | 19 | ||
20 | static const char *brcmstb_match[] __initconst = { | 20 | static const char *const brcmstb_match[] __initconst = { |
21 | "brcm,bcm7445", | 21 | "brcm,bcm7445", |
22 | "brcm,brcmstb", | 22 | "brcm,brcmstb", |
23 | NULL | 23 | NULL |
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index 2013f73797ed..9e9dfdfad9d7 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c | |||
@@ -227,7 +227,7 @@ static void __init exynos_dt_machine_init(void) | |||
227 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 227 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
228 | } | 228 | } |
229 | 229 | ||
230 | static char const *exynos_dt_compat[] __initconst = { | 230 | static char const *const exynos_dt_compat[] __initconst = { |
231 | "samsung,exynos3", | 231 | "samsung,exynos3", |
232 | "samsung,exynos3250", | 232 | "samsung,exynos3250", |
233 | "samsung,exynos4", | 233 | "samsung,exynos4", |
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index 07a09570175d..231fba0d03e5 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c | |||
@@ -169,7 +169,7 @@ static void __init highbank_init(void) | |||
169 | platform_device_register(&highbank_cpuidle_device); | 169 | platform_device_register(&highbank_cpuidle_device); |
170 | } | 170 | } |
171 | 171 | ||
172 | static const char *highbank_match[] __initconst = { | 172 | static const char *const highbank_match[] __initconst = { |
173 | "calxeda,highbank", | 173 | "calxeda,highbank", |
174 | "calxeda,ecx-2000", | 174 | "calxeda,ecx-2000", |
175 | NULL, | 175 | NULL, |
diff --git a/arch/arm/mach-hisi/hisilicon.c b/arch/arm/mach-hisi/hisilicon.c index 76b907078b58..c6bd7c7bd4aa 100644 --- a/arch/arm/mach-hisi/hisilicon.c +++ b/arch/arm/mach-hisi/hisilicon.c | |||
@@ -45,7 +45,7 @@ static void __init hi3620_map_io(void) | |||
45 | iotable_init(hi3620_io_desc, ARRAY_SIZE(hi3620_io_desc)); | 45 | iotable_init(hi3620_io_desc, ARRAY_SIZE(hi3620_io_desc)); |
46 | } | 46 | } |
47 | 47 | ||
48 | static const char *hi3xxx_compat[] __initconst = { | 48 | static const char *const hi3xxx_compat[] __initconst = { |
49 | "hisilicon,hi3620-hi4511", | 49 | "hisilicon,hi3620-hi4511", |
50 | NULL, | 50 | NULL, |
51 | }; | 51 | }; |
@@ -55,7 +55,7 @@ DT_MACHINE_START(HI3620, "Hisilicon Hi3620 (Flattened Device Tree)") | |||
55 | .dt_compat = hi3xxx_compat, | 55 | .dt_compat = hi3xxx_compat, |
56 | MACHINE_END | 56 | MACHINE_END |
57 | 57 | ||
58 | static const char *hix5hd2_compat[] __initconst = { | 58 | static const char *const hix5hd2_compat[] __initconst = { |
59 | "hisilicon,hix5hd2", | 59 | "hisilicon,hix5hd2", |
60 | NULL, | 60 | NULL, |
61 | }; | 61 | }; |
@@ -64,7 +64,7 @@ DT_MACHINE_START(HIX5HD2_DT, "Hisilicon HIX5HD2 (Flattened Device Tree)") | |||
64 | .dt_compat = hix5hd2_compat, | 64 | .dt_compat = hix5hd2_compat, |
65 | MACHINE_END | 65 | MACHINE_END |
66 | 66 | ||
67 | static const char *hip04_compat[] __initconst = { | 67 | static const char *const hip04_compat[] __initconst = { |
68 | "hisilicon,hip04-d01", | 68 | "hisilicon,hip04-d01", |
69 | NULL, | 69 | NULL, |
70 | }; | 70 | }; |
@@ -73,7 +73,7 @@ DT_MACHINE_START(HIP04, "Hisilicon HiP04 (Flattened Device Tree)") | |||
73 | .dt_compat = hip04_compat, | 73 | .dt_compat = hip04_compat, |
74 | MACHINE_END | 74 | MACHINE_END |
75 | 75 | ||
76 | static const char *hip01_compat[] __initconst = { | 76 | static const char *const hip01_compat[] __initconst = { |
77 | "hisilicon,hip01", | 77 | "hisilicon,hip01", |
78 | "hisilicon,hip01-ca9x2", | 78 | "hisilicon,hip01-ca9x2", |
79 | NULL, | 79 | NULL, |
diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c index 7f352de26099..06620875813a 100644 --- a/arch/arm/mach-keystone/keystone.c +++ b/arch/arm/mach-keystone/keystone.c | |||
@@ -103,7 +103,7 @@ static void __init keystone_init_meminfo(void) | |||
103 | pr_info("Switching to high address space at 0x%llx\n", (u64)offset); | 103 | pr_info("Switching to high address space at 0x%llx\n", (u64)offset); |
104 | } | 104 | } |
105 | 105 | ||
106 | static const char *keystone_match[] __initconst = { | 106 | static const char *const keystone_match[] __initconst = { |
107 | "ti,keystone", | 107 | "ti,keystone", |
108 | NULL, | 108 | NULL, |
109 | }; | 109 | }; |
diff --git a/arch/arm/mach-nspire/nspire.c b/arch/arm/mach-nspire/nspire.c index 3d24ebf12095..3445a5686805 100644 --- a/arch/arm/mach-nspire/nspire.c +++ b/arch/arm/mach-nspire/nspire.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include "mmio.h" | 27 | #include "mmio.h" |
28 | #include "clcd.h" | 28 | #include "clcd.h" |
29 | 29 | ||
30 | static const char *nspire_dt_match[] __initconst = { | 30 | static const char *const nspire_dt_match[] __initconst = { |
31 | "ti,nspire", | 31 | "ti,nspire", |
32 | "ti,nspire-cx", | 32 | "ti,nspire-cx", |
33 | "ti,nspire-tp", | 33 | "ti,nspire-tp", |
diff --git a/arch/arm/mach-prima2/common.c b/arch/arm/mach-prima2/common.c index 0c819bb88418..8cadb302a7d2 100644 --- a/arch/arm/mach-prima2/common.c +++ b/arch/arm/mach-prima2/common.c | |||
@@ -21,7 +21,7 @@ static void __init sirfsoc_init_late(void) | |||
21 | } | 21 | } |
22 | 22 | ||
23 | #ifdef CONFIG_ARCH_ATLAS6 | 23 | #ifdef CONFIG_ARCH_ATLAS6 |
24 | static const char *atlas6_dt_match[] __initconst = { | 24 | static const char *const atlas6_dt_match[] __initconst = { |
25 | "sirf,atlas6", | 25 | "sirf,atlas6", |
26 | NULL | 26 | NULL |
27 | }; | 27 | }; |
@@ -36,7 +36,7 @@ MACHINE_END | |||
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | #ifdef CONFIG_ARCH_PRIMA2 | 38 | #ifdef CONFIG_ARCH_PRIMA2 |
39 | static const char *prima2_dt_match[] __initconst = { | 39 | static const char *const prima2_dt_match[] __initconst = { |
40 | "sirf,prima2", | 40 | "sirf,prima2", |
41 | NULL | 41 | NULL |
42 | }; | 42 | }; |
@@ -52,7 +52,7 @@ MACHINE_END | |||
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | #ifdef CONFIG_ARCH_ATLAS7 | 54 | #ifdef CONFIG_ARCH_ATLAS7 |
55 | static const char *atlas7_dt_match[] __initdata = { | 55 | static const char *const atlas7_dt_match[] __initconst = { |
56 | "sirf,atlas7", | 56 | "sirf,atlas7", |
57 | NULL | 57 | NULL |
58 | }; | 58 | }; |
diff --git a/arch/arm/mach-s5pv210/s5pv210.c b/arch/arm/mach-s5pv210/s5pv210.c index 43eb1eaea0c9..83e656ea95ae 100644 --- a/arch/arm/mach-s5pv210/s5pv210.c +++ b/arch/arm/mach-s5pv210/s5pv210.c | |||
@@ -63,7 +63,7 @@ static void __init s5pv210_dt_init_late(void) | |||
63 | s5pv210_pm_init(); | 63 | s5pv210_pm_init(); |
64 | } | 64 | } |
65 | 65 | ||
66 | static char const *s5pv210_dt_compat[] __initconst = { | 66 | static char const *const s5pv210_dt_compat[] __initconst = { |
67 | "samsung,s5pc110", | 67 | "samsung,s5pc110", |
68 | "samsung,s5pv210", | 68 | "samsung,s5pv210", |
69 | NULL | 69 | NULL |
diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c index aad97be9cbe1..37f7b15c01bc 100644 --- a/arch/arm/mach-shmobile/setup-emev2.c +++ b/arch/arm/mach-shmobile/setup-emev2.c | |||
@@ -37,7 +37,7 @@ static void __init emev2_map_io(void) | |||
37 | iotable_init(emev2_io_desc, ARRAY_SIZE(emev2_io_desc)); | 37 | iotable_init(emev2_io_desc, ARRAY_SIZE(emev2_io_desc)); |
38 | } | 38 | } |
39 | 39 | ||
40 | static const char *emev2_boards_compat_dt[] __initconst = { | 40 | static const char *const emev2_boards_compat_dt[] __initconst = { |
41 | "renesas,emev2", | 41 | "renesas,emev2", |
42 | NULL, | 42 | NULL, |
43 | }; | 43 | }; |
diff --git a/arch/arm/mach-versatile/versatile_dt.c b/arch/arm/mach-versatile/versatile_dt.c index 9f9bc61ca64b..7de3e92a13b0 100644 --- a/arch/arm/mach-versatile/versatile_dt.c +++ b/arch/arm/mach-versatile/versatile_dt.c | |||
@@ -35,7 +35,7 @@ static void __init versatile_dt_init(void) | |||
35 | versatile_auxdata_lookup, NULL); | 35 | versatile_auxdata_lookup, NULL); |
36 | } | 36 | } |
37 | 37 | ||
38 | static const char *versatile_dt_match[] __initconst = { | 38 | static const char *const versatile_dt_match[] __initconst = { |
39 | "arm,versatile-ab", | 39 | "arm,versatile-ab", |
40 | "arm,versatile-pb", | 40 | "arm,versatile-pb", |
41 | NULL, | 41 | NULL, |