[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdanCp5nWL4cQQ0m-3myfVtzveJTP7f160v207ATGXTL=g@mail.gmail.com>
Date: Wed, 2 Aug 2017 10:23:00 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Julia Lawall <Julia.Lawall@...6.fr>
Cc: Kees Cook <keescook@...omium.org>, kernel-janitors@...r.kernel.org,
Tejun Heo <tj@...nel.org>, linux-ide@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 08/11] ata: Drop unnecessary static
On Sat, Jul 15, 2017 at 10:07 PM, Julia Lawall <Julia.Lawall@...6.fr> wrote:
> Drop static on a local variable, when the variable is initialized before
> any possible use. Thus, the static has no benefit.
>
> The semantic patch that fixes this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @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;
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@...6.fr>
Acked-by: Linus Walleij <linus.walleij@...aro.org>
Yours,
Linus Walleij
Powered by blists - more mailing lists