Re: [PATCH] soc: integrator: remove unnecessary static in integrator_soc_init()

From: Gustavo A. R. Silva
Date: Thu Aug 03 2017 - 17:45:59 EST


Hi Linus,

On 08/02/2017 06:58 AM, Linus Walleij wrote:
On Thu, Jul 20, 2017 at 12:39 AM, Gustavo A. R. Silva
<gustavo@xxxxxxxxxxxxxx> wrote:

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;

Signed-off-by: Gustavo A. R. Silva <gustavo@xxxxxxxxxxxxxx>

Acked-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

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
--
Gustavo A. R. Silva