Thread (6 messages) 6 messages, 4 authors, 2017-08-02

Re: [PATCH 08/11] ata: Drop unnecessary static

From: Linus Walleij <hidden>
Date: 2017-08-02 08:23:04
Also in: kernel-janitors, lkml

On Sat, Jul 15, 2017 at 10:07 PM, Julia Lawall [off-list ref] 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 <redacted>
Acked-by: Linus Walleij <redacted>

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help