[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170802151259.GC2311718@devbig577.frc2.facebook.com>
Date: Wed, 2 Aug 2017 08:12:59 -0700
From: Tejun Heo <tj@...nel.org>
To: Julia Lawall <Julia.Lawall@...6.fr>
Cc: Linus Walleij <linus.walleij@...aro.org>, keescook@...omium.org,
kernel-janitors@...r.kernel.org, linux-ide@...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:43PM +0200, Julia Lawall 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>
Applied to libata/for-4.14.
Thanks.
--
tejun
Powered by blists - more mailing lists