usb: make i2c_client const
PATCH 1/1 usb: make i2c_client const
Make these const as they are only used in a copy operation. Done using Coccinelle.
@match disable optional_qualifier@
identifier s;
@@
static struct i2c_client s = {...};
@ref@
position p;
identifier match.s;
@@
s@p
@good1@
position ref.p;
identifier match.s,f,c;
expression e;
@@
(
e = s@p
|
e = [email protected]
|c(...,[email protected],...)
|c(...,s@p,...)
)
@bad depends on !good1@
position ref.p;
identifier match.s;
@@
s@p
@depends on forall !bad disable optional_qualifier@ identifier match.s;
@@
static
+ const
struct i2c_client s;
Signed-off-by Bhumika Goyal <[email protected]>
--- drivers/media/usb/au0828/au0828-i2c.c | 2 +- drivers/media/usb/em28xx/em28xx-i2c.c | 2 +- drivers/media/usb/stk1160/stk1160-i2c.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/media/usb/au0828/au0828-i2c.c +1 -1
@@ -342,7 +342,7 @@ static u32 au0828_functionality(struct i2c_adapter *adap) .algo = &au0828_i2c_algo_template, }; -static struct i2c_client au0828_i2c_client_template = { +static const struct i2c_client au0828_i2c_client_template = { .name ="au0828 internal" , };
drivers/media/usb/em28xx/em28xx-i2c.c +1 -1
@@ -882,7 +882,7 @@ static u32 functionality(struct i2c_adapter *i2c_adap) .algo = &em28xx_algo, }; -static struct i2c_client em28xx_client_template = { +static const struct i2c_client em28xx_client_template = { .name ="em28xx internal" , };
drivers/media/usb/stk1160/stk1160-i2c.c +1 -1
@@ -246,7 +246,7 @@ static u32 functionality(struct i2c_adapter *adap) .algo = &algo, }; -static struct i2c_client client_template = { +static const struct i2c_client client_template = { .name ="stk1160 internal" , };
Signature · 1 line
1.9.1