ARM: omap1: add const and initconst to omap_lcd_config
Subsystems (3)
PATCH 1/1 ARM: omap1: add const and initconst to omap_lcd_config
Make these const as they are only passed to a const argument of the function omapfb_set_lcd_config.
Also, replace __initdata with __initconst to avoid section conflict error. Done using Coccinelle.
@match disable optional_qualifier@
identifier s;
@@
static struct omap_lcd_config s = {...};
@ref@
position p;
identifier match.s;
@@
s at p
@good1@
identifier match.s;
position ref.p;
@@omapfb_set_lcd_config(&s at p,...)
@bad depends on !good1@
position ref.p;
identifier match.s;
@@
s at p
@depends on forall !bad disable optional_qualifier@ identifier match.s;
@@
static
+ const
struct omap_lcd_config s;
--- arch/arm/mach-omap1/board-ams-delta.c | 2 +- arch/arm/mach-omap1/board-fsample.c | 2 +- arch/arm/mach-omap1/board-h2.c | 2 +- arch/arm/mach-omap1/board-h3.c | 2 +- arch/arm/mach-omap1/board-htcherald.c | 2 +- arch/arm/mach-omap1/board-innovator.c | 4 ++-- arch/arm/mach-omap1/board-nokia770.c | 2 +- arch/arm/mach-omap1/board-osk.c | 2 +- arch/arm/mach-omap1/board-palmte.c | 2 +- arch/arm/mach-omap1/board-palmtt.c | 2 +- arch/arm/mach-omap1/board-palmz71.c | 2 +- arch/arm/mach-omap1/board-perseus2.c | 2 +- arch/arm/mach-omap1/board-sx1.c | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-)
arch/arm/mach-omap1/board-ams-delta.c +1 -1
@@ -156,7 +156,7 @@ } }; -static struct omap_lcd_config ams_delta_lcd_config__initdata = { +static const struct omap_lcd_config ams_delta_lcd_config__initconst = { .ctrl_name ="internal" , };
arch/arm/mach-omap1/board-fsample.c +1 -1
@@ -266,7 +266,7 @@ static int nand_dev_ready(struct mtd_info *mtd) &kp_device, }; -static struct omap_lcd_config fsample_lcd_config = { +static const struct omap_lcd_config fsample_lcd_config = { .ctrl_name ="internal" , };
arch/arm/mach-omap1/board-h2.c +1 -1
@@ -357,7 +357,7 @@ static int tps_setup(struct i2c_client *client, void *context) .pins[1] = 3, }; -static struct omap_lcd_config h2_lcd_config__initdata = { +static const struct omap_lcd_config h2_lcd_config__initconst = { .ctrl_name ="internal" , };
arch/arm/mach-omap1/board-h3.c +1 -1
@@ -376,7 +376,7 @@ static void __init h3_init_smc91x(void) .pins[1] = 3, }; -static struct omap_lcd_config h3_lcd_config__initdata = { +static const struct omap_lcd_config h3_lcd_config__initconst = { .ctrl_name ="internal" , };
arch/arm/mach-omap1/board-htcherald.c +1 -1
@@ -391,7 +391,7 @@ };/* LCD Device resources */ -static struct omap_lcd_config htcherald_lcd_config__initdata = { +static const struct omap_lcd_config htcherald_lcd_config__initconst = { .ctrl_name ="internal" , };
arch/arm/mach-omap1/board-innovator.c +2 -2
@@ -302,7 +302,7 @@ static void __init innovator_init_smc91x(void) .pins[0] = 2, }; -static struct omap_lcd_config innovator1510_lcd_config__initdata = { +static const struct omap_lcd_config innovator1510_lcd_config__initconst = { .ctrl_name ="internal" , };#endif
@@ -323,7 +323,7 @@ static void __init innovator_init_smc91x(void) .pins[1] = 3, }; -static struct omap_lcd_config innovator1610_lcd_config__initdata = { +static const struct omap_lcd_config innovator1610_lcd_config__initconst = { .ctrl_name ="internal" , };#endif
arch/arm/mach-omap1/board-nokia770.c +1 -1
@@ -103,7 +103,7 @@ static void mipid_shutdown(struct mipid_platform_data *pdata) .shutdown = mipid_shutdown, }; -static struct omap_lcd_config nokia770_lcd_config__initdata = { +static const struct omap_lcd_config nokia770_lcd_config__initconst = { .ctrl_name ="hwa742" , };
arch/arm/mach-omap1/board-osk.c +1 -1
@@ -295,7 +295,7 @@ static void __init osk_init_cf(void) };#ifdef CONFIG_OMAP_OSK_MISTRAL -static struct omap_lcd_config osk_lcd_config__initdata = { +static const struct omap_lcd_config osk_lcd_config__initconst = { .ctrl_name ="internal" , };#endif
arch/arm/mach-omap1/board-palmte.c +1 -1
@@ -178,7 +178,7 @@ .pins[0] = 2, }; -static struct omap_lcd_config palmte_lcd_config__initdata = { +static const struct omap_lcd_config palmte_lcd_config__initconst = { .ctrl_name ="internal" , };
arch/arm/mach-omap1/board-palmtt.c +1 -1
@@ -241,7 +241,7 @@ static int palmtt_get_pendown_state(void) .pins[0] = 2, }; -static struct omap_lcd_config palmtt_lcd_config__initdata = { +static const struct omap_lcd_config palmtt_lcd_config__initconst = { .ctrl_name ="internal" , };
arch/arm/mach-omap1/board-palmz71.c +1 -1
@@ -206,7 +206,7 @@ .pins[0] = 2, }; -static struct omap_lcd_config palmz71_lcd_config__initdata = { +static const struct omap_lcd_config palmz71_lcd_config__initconst = { .ctrl_name ="internal" , };
arch/arm/mach-omap1/board-perseus2.c +1 -1
@@ -225,7 +225,7 @@ static int nand_dev_ready(struct mtd_info *mtd) &kp_device, }; -static struct omap_lcd_config perseus2_lcd_config__initdata = { +static const struct omap_lcd_config perseus2_lcd_config__initconst = { .ctrl_name ="internal" , };
arch/arm/mach-omap1/board-sx1.c +1 -1
@@ -297,7 +297,7 @@ int sx1_setusbpower(u8 onoff)/*----------- LCD -------------------------*/ -static struct omap_lcd_config sx1_lcd_config__initdata = { +static const struct omap_lcd_config sx1_lcd_config__initconst = { .ctrl_name ="internal" , };
Signature · 1 line
1.9.1
Tony Lindgren
reviewerQuoted 4 lines · Bhumika Goyal
Make these const as they are only passed to a const argument of the function
omapfb_set_lcd_config.
Also, replace__initdatawith__initconstto avoid section conflict error. Done using Coccinelle.
Applying into omap-for-v4.15/omap1 thanks.
Tony