From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [PATCH 08/11] ata: Drop unnecessary static Date: Wed, 2 Aug 2017 08:12:59 -0700 Message-ID: <20170802151259.GC2311718@devbig577.frc2.facebook.com> References: <1500149266-32357-1-git-send-email-Julia.Lawall@lip6.fr> <1500149266-32357-9-git-send-email-Julia.Lawall@lip6.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1500149266-32357-9-git-send-email-Julia.Lawall@lip6.fr> Sender: kernel-janitors-owner@vger.kernel.org To: Julia Lawall Cc: Linus Walleij , keescook@chromium.org, kernel-janitors@vger.kernel.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-ide@vger.kernel.org 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/) > > // > @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; > // > > Signed-off-by: Julia Lawall Applied to libata/for-4.14. Thanks. -- tejun