[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <2086929.avP79hnAKk@amdc3058>
Date: Tue, 01 Aug 2017 15:09:57 +0200
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
To: Julia Lawall <Julia.Lawall@...6.fr>
Cc: keescook@...omium.org, kernel-janitors@...r.kernel.org,
linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 04/11] fbdev: da8xx-fb: Drop unnecessary static
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 <Julia.Lawall@...6.fr>
Patch queued for 4.14, thanks.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
Powered by blists - more mailing lists