Thread (5 messages) 5 messages, 3 authors, 2017-08-01

Re: [PATCH 04/11] fbdev: da8xx-fb: Drop unnecessary static

From: Bartlomiej Zolnierkiewicz <hidden>
Date: 2017-08-01 13:10:04
Also in: kernel-janitors, lkml

On Saturday, July 15, 2017 10:07:39 PM 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 <redacted>
Patch queued for 4.14, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help