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

From: Linus Walleij
Date: Wed Aug 02 2017 - 07:58:49 EST


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.

Yours,
Linus Walleij