Skip to contentSkip to conversation

MIPS: AR7: constify some arrays in gpio and prom code

PATCH In review Florian Fainelli 2 participants 2 messages Nov 4, 2011 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: AR7: constify some arrays in gpio and prom code

---
 arch/mips/ar7/gpio.c |    2 +-
 arch/mips/ar7/prom.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
arch/mips/ar7/gpio.c +1 -1
index bb571bc..d8dbd8f 100644
@@ -217,7 +217,7 @@ struct titan_gpio_cfg {
 	u32 func;
 };
 
-static struct titan_gpio_cfg titan_gpio_table[] = {
+static const struct titan_gpio_cfg titan_gpio_table[] = {
 	/* reg, start bit, mux value */
 	{4, 24, 1},
 	{4, 26, 1},
arch/mips/ar7/prom.c +2 -2
index 8088c6f..f642f64 100644
@@ -69,7 +69,7 @@ struct psbl_rec {
 	u32	ffs_size;
 };
 
-static __initdata char psp_env_version[] = "TIENV0.8";
+static __initdata const char psp_env_version[] = "TIENV0.8";
 
 struct psp_env_chunk {
 	u8	num;
@@ -84,7 +84,7 @@ struct psp_var_map_entry {
 	char	*value;
 };
 
-static struct psp_var_map_entry psp_var_map[] = {
+static const struct psp_var_map_entry psp_var_map[] = {
 	{  1,	"cpufrequency" },
 	{  2,	"memsize" },
 	{  3,	"flashsize" },
Signature · 1 line
1.7.5.4
#1 lore raw

arch/mips/ar7/prom.c struct psbl_rec { · line 72

Quoted 10 lines · Florian Fainelli
arch/mips/ar7/prom.c +1 -1
index 8088c6f..f642f64 100644
@@ -69,7 +69,7 @@ struct psbl_rec {
 	u32	ffs_size;
 };
 
-static __initdata char psp_env_version[] = "TIENV0.8";
+static __initdata const char psp_env_version[] = "TIENV0.8";

Should be:

static const char psp_env_version[] __initconst = "TIENV0.8";

so psp_env_version actually ends up in a read-only section.

Ralf