Skip to contentSkip to conversation

Blackfin: bf527: make musb_hdrc_config const

PATCH New Bhumika Goyal 1 participant 1 message Aug 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Blackfin: bf527: make musb_hdrc_config const

Make these const as they are only stored in the const field of a musb_hdrc_platform_data structure.
Done using Coccinelle.

@match disable optional_qualifier@
identifier s;
@@
static struct musb_hdrc_config s = {...};

@ref@
position p;
identifier match.s;
@@
s@p

@good1@
identifier y;
position ref.p;
identifier match.s;
@@
struct musb_hdrc_platform_data y = {...,.config=&s@p,...};

@good2@
struct musb_hdrc_platform_data y;
identifier match.s;
position ref.p;
@@
y.config = &s@p

@bad depends on !good1 && !good2@
position ref.p;
identifier match.s;
@@
s@p

@depends on forall !bad disable optional_qualifier@ identifier match.s;
@@
static
+ const
struct musb_hdrc_config s;

---
 arch/blackfin/mach-bf527/boards/ad7160eval.c | 2 +-
 arch/blackfin/mach-bf527/boards/cm_bf527.c   | 2 +-
 arch/blackfin/mach-bf527/boards/ezbrd.c      | 2 +-
 arch/blackfin/mach-bf527/boards/ezkit.c      | 2 +-
 arch/blackfin/mach-bf527/boards/tll6527m.c   | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
arch/blackfin/mach-bf527/boards/ad7160eval.c +1 -1
index 68f2a8a..114575b 100644
@@ -56,7 +56,7 @@
 	},
 };
 
-static struct musb_hdrc_config musb_config = {
+static const struct musb_hdrc_config musb_config = {
 	.multipoint	= 0,
 	.dyn_fifo	= 0,
 	.soft_con	= 1,
arch/blackfin/mach-bf527/boards/cm_bf527.c +1 -1
index b1004b3..44ccaf4 100644
@@ -93,7 +93,7 @@
 	},
 };
 
-static struct musb_hdrc_config musb_config = {
+static const struct musb_hdrc_config musb_config = {
 	.multipoint	= 0,
 	.dyn_fifo	= 0,
 	.soft_con	= 1,
arch/blackfin/mach-bf527/boards/ezbrd.c +1 -1
index 80bcfd1..2ef2ffa 100644
@@ -57,7 +57,7 @@
 	},
 };
 
-static struct musb_hdrc_config musb_config = {
+static const struct musb_hdrc_config musb_config = {
 	.multipoint	= 0,
 	.dyn_fifo	= 0,
 	.soft_con	= 1,
arch/blackfin/mach-bf527/boards/ezkit.c +1 -1
index 571edfd..33539d4 100644
@@ -98,7 +98,7 @@
 	},
 };
 
-static struct musb_hdrc_config musb_config = {
+static const struct musb_hdrc_config musb_config = {
 	.multipoint	= 0,
 	.dyn_fifo	= 0,
 	.soft_con	= 1,
arch/blackfin/mach-bf527/boards/tll6527m.c +1 -1
index ce5488e..29ac9c3 100644
@@ -63,7 +63,7 @@
 	},
 };
 
-static struct musb_hdrc_config musb_config = {
+static const struct musb_hdrc_config musb_config = {
 	.multipoint	= 0,
 	.dyn_fifo	= 0,
 	.soft_con	= 1,
Signature · 1 line
1.9.1