diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2014-09-11 15:29:01 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2014-09-11 15:34:36 -0400 |
commit | 58cda01ed18945c17ad858dfcf4a9a74ba70157c (patch) | |
tree | 2d865efed4cb45c4422ce5c2528b04ad4a52039f | |
parent | d7eb67f7fef9c046f27a975118da2324de65a90c (diff) |
ARM: omap2: make arrays containing machine compatible strings const
The definition
static const char *omap3_boards_compat[] __initconst = {
defines a changable array of constant strings. That is you must not do:
*omap3_boards_compat[0] = 'f';
but
omap3_boards_compat[0] = "another 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: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | arch/arm/mach-omap2/board-generic.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 9480997ba616..04eaccf00ed8 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -43,7 +43,7 @@ static void __init omap_generic_init(void) | |||
43 | } | 43 | } |
44 | 44 | ||
45 | #ifdef CONFIG_SOC_OMAP2420 | 45 | #ifdef CONFIG_SOC_OMAP2420 |
46 | static const char *omap242x_boards_compat[] __initconst = { | 46 | static const char *const omap242x_boards_compat[] __initconst = { |
47 | "ti,omap2420", | 47 | "ti,omap2420", |
48 | NULL, | 48 | NULL, |
49 | }; | 49 | }; |
@@ -62,7 +62,7 @@ MACHINE_END | |||
62 | #endif | 62 | #endif |
63 | 63 | ||
64 | #ifdef CONFIG_SOC_OMAP2430 | 64 | #ifdef CONFIG_SOC_OMAP2430 |
65 | static const char *omap243x_boards_compat[] __initconst = { | 65 | static const char *const omap243x_boards_compat[] __initconst = { |
66 | "ti,omap2430", | 66 | "ti,omap2430", |
67 | NULL, | 67 | NULL, |
68 | }; | 68 | }; |
@@ -81,7 +81,7 @@ MACHINE_END | |||
81 | #endif | 81 | #endif |
82 | 82 | ||
83 | #ifdef CONFIG_ARCH_OMAP3 | 83 | #ifdef CONFIG_ARCH_OMAP3 |
84 | static const char *omap3_boards_compat[] __initconst = { | 84 | static const char *const omap3_boards_compat[] __initconst = { |
85 | "ti,omap3430", | 85 | "ti,omap3430", |
86 | "ti,omap3", | 86 | "ti,omap3", |
87 | NULL, | 87 | NULL, |
@@ -100,7 +100,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)") | |||
100 | .restart = omap3xxx_restart, | 100 | .restart = omap3xxx_restart, |
101 | MACHINE_END | 101 | MACHINE_END |
102 | 102 | ||
103 | static const char *omap36xx_boards_compat[] __initconst = { | 103 | static const char *const omap36xx_boards_compat[] __initconst = { |
104 | "ti,omap36xx", | 104 | "ti,omap36xx", |
105 | NULL, | 105 | NULL, |
106 | }; | 106 | }; |
@@ -118,7 +118,7 @@ DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened Device Tree)") | |||
118 | .restart = omap3xxx_restart, | 118 | .restart = omap3xxx_restart, |
119 | MACHINE_END | 119 | MACHINE_END |
120 | 120 | ||
121 | static const char *omap3_gp_boards_compat[] __initconst = { | 121 | static const char *const omap3_gp_boards_compat[] __initconst = { |
122 | "ti,omap3-beagle", | 122 | "ti,omap3-beagle", |
123 | "timll,omap3-devkit8000", | 123 | "timll,omap3-devkit8000", |
124 | NULL, | 124 | NULL, |
@@ -137,7 +137,7 @@ DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)") | |||
137 | .restart = omap3xxx_restart, | 137 | .restart = omap3xxx_restart, |
138 | MACHINE_END | 138 | MACHINE_END |
139 | 139 | ||
140 | static const char *am3517_boards_compat[] __initconst = { | 140 | static const char *const am3517_boards_compat[] __initconst = { |
141 | "ti,am3517", | 141 | "ti,am3517", |
142 | NULL, | 142 | NULL, |
143 | }; | 143 | }; |
@@ -157,7 +157,7 @@ MACHINE_END | |||
157 | #endif | 157 | #endif |
158 | 158 | ||
159 | #ifdef CONFIG_SOC_AM33XX | 159 | #ifdef CONFIG_SOC_AM33XX |
160 | static const char *am33xx_boards_compat[] __initconst = { | 160 | static const char *const am33xx_boards_compat[] __initconst = { |
161 | "ti,am33xx", | 161 | "ti,am33xx", |
162 | NULL, | 162 | NULL, |
163 | }; | 163 | }; |
@@ -177,7 +177,7 @@ MACHINE_END | |||
177 | #endif | 177 | #endif |
178 | 178 | ||
179 | #ifdef CONFIG_ARCH_OMAP4 | 179 | #ifdef CONFIG_ARCH_OMAP4 |
180 | static const char *omap4_boards_compat[] __initconst = { | 180 | static const char *const omap4_boards_compat[] __initconst = { |
181 | "ti,omap4460", | 181 | "ti,omap4460", |
182 | "ti,omap4430", | 182 | "ti,omap4430", |
183 | "ti,omap4", | 183 | "ti,omap4", |
@@ -199,7 +199,7 @@ MACHINE_END | |||
199 | #endif | 199 | #endif |
200 | 200 | ||
201 | #ifdef CONFIG_SOC_OMAP5 | 201 | #ifdef CONFIG_SOC_OMAP5 |
202 | static const char *omap5_boards_compat[] __initconst = { | 202 | static const char *const omap5_boards_compat[] __initconst = { |
203 | "ti,omap5432", | 203 | "ti,omap5432", |
204 | "ti,omap5430", | 204 | "ti,omap5430", |
205 | "ti,omap5", | 205 | "ti,omap5", |
@@ -221,7 +221,7 @@ MACHINE_END | |||
221 | #endif | 221 | #endif |
222 | 222 | ||
223 | #ifdef CONFIG_SOC_AM43XX | 223 | #ifdef CONFIG_SOC_AM43XX |
224 | static const char *am43_boards_compat[] __initconst = { | 224 | static const char *const am43_boards_compat[] __initconst = { |
225 | "ti,am4372", | 225 | "ti,am4372", |
226 | "ti,am43", | 226 | "ti,am43", |
227 | NULL, | 227 | NULL, |
@@ -240,7 +240,7 @@ MACHINE_END | |||
240 | #endif | 240 | #endif |
241 | 241 | ||
242 | #ifdef CONFIG_SOC_DRA7XX | 242 | #ifdef CONFIG_SOC_DRA7XX |
243 | static const char *dra74x_boards_compat[] __initconst = { | 243 | static const char *const dra74x_boards_compat[] __initconst = { |
244 | "ti,dra742", | 244 | "ti,dra742", |
245 | "ti,dra7", | 245 | "ti,dra7", |
246 | NULL, | 246 | NULL, |
@@ -259,7 +259,7 @@ DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)") | |||
259 | .restart = omap44xx_restart, | 259 | .restart = omap44xx_restart, |
260 | MACHINE_END | 260 | MACHINE_END |
261 | 261 | ||
262 | static const char *dra72x_boards_compat[] __initconst = { | 262 | static const char *const dra72x_boards_compat[] __initconst = { |
263 | "ti,dra722", | 263 | "ti,dra722", |
264 | NULL, | 264 | NULL, |
265 | }; | 265 | }; |