]> asedeno.scripts.mit.edu Git - linux.git/commit
ata: Drop unnecessary static
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 15 Jul 2017 20:07:43 +0000 (22:07 +0200)
committerTejun Heo <tj@kernel.org>
Wed, 2 Aug 2017 15:11:53 +0000 (08:11 -0700)
commitcea9c8d34464fb11c82bd32b4cd57b9fcc834995
tree573132b63c2ed87c2744231749d65df81c919ca5
parentcf8984bf84c383ca1a7282bc6409c9684e6dc3a4
ata: Drop unnecessary static

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>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/sata_gemini.c