lkml.org 
[lkml]   [2017]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@lip6.fr>

Applied to libata/for-4.14.

Thanks.

--
tejun

\
 
 \ /
  Last update: 2017-08-02 17:13    [W:4.284 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site