soc: integrator: remove unnecessary static in integrator_soc_init()
PATCH 1/1 soc: integrator: remove unnecessary static in integrator_soc_init()
Remove unnecessary static on local variable syscon_regmap. Such variables are initialized before being used, on every execution path throughout the functions. So, the static has no benefit.
This issue was detected using Coccinelle and the following semantic patch:
@bad exists@
position p;
identifier x;
type T;
@@
static T x@p;
...
x = <+...x...+>
@@
identifier x;
expression e;
type T;
position p != bad.p;
@@
-static
T x@p;
... when != x
when strict
?x = e;
--- drivers/soc/versatile/soc-integrator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/versatile/soc-integrator.c +1 -1
@@ -102,7 +102,7 @@ static struct device_attribute integrator_build_attr =static int __init integrator_soc_init (void ) { -static struct regmap *syscon_regmap; +struct regmap *syscon_regmap;struct soc_device *soc_dev;struct soc_device_attribute *soc_dev_attr;struct device_node *np;
Signature · 1 line
2.5.0
Quoted 25 lines · Gustavo A. R. Silva
Remove unnecessary static on local variable
syscon_regmap. Such variables are initialized before being used, on every execution path throughout the functions. So, the static has no benefit.This issue was detected using Coccinelle and the following semantic patch:
@bad exists@
position p;
identifier x;
type T;
@@static T x@p;
...
x = <+...x...+>@@
identifier x;
expression e;
type T;
position p != bad.p;
@@
Quoted 7 lines
-static
T x@p;
... when != x
when strict
?x = e;Signed-off-by Gustavo A. R. Silva <[email protected]>
You probably want to funnel this patch through the ARM SoC tree.
Yours,
Linus Walleij
Hi Linus,
Quoted 34 lines · Linus Walleij
Quoted 31 lines · Gustavo A. R. Silva
Remove unnecessary static on local variable
syscon_regmap. Such variables are initialized before being used, on every execution path throughout the functions. So, the static has no benefit.This issue was detected using Coccinelle and the following semantic patch:
@bad exists@
position p;
identifier x;
type T;
@@static T x@p;
...
x = <+...x...+>@@
identifier x;
expression e;
type T;
position p != bad.p;
@@-static
T x@p;
... when != x
when strict
?x = e;
Quoted 6 lines
Quoted 1 line
Signed-off-by Gustavo A. R. Silva <[email protected]>Acked-by Linus Walleij <[email protected]>You probably want to funnel this patch through the ARM SoC tree.
I'll do that. I'll add your ACK and CC you.
Thanks
Signature · 1 line
Gustavo A. R. Silva