Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752724AbdHBPNH (ORCPT ); Wed, 2 Aug 2017 11:13:07 -0400 Received: from mail-qk0-f182.google.com ([209.85.220.182]:35317 "EHLO mail-qk0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752314AbdHBPNF (ORCPT ); Wed, 2 Aug 2017 11:13:05 -0400 Date: Wed, 2 Aug 2017 08:12:59 -0700 From: Tejun Heo To: Julia Lawall Cc: Linus Walleij , keescook@chromium.org, kernel-janitors@vger.kernel.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/11] ata: Drop unnecessary static 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 Content-Disposition: inline In-Reply-To: <1500149266-32357-9-git-send-email-Julia.Lawall@lip6.fr> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 662 Lines: 38 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