Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752225AbdGRBb6 (ORCPT ); Mon, 17 Jul 2017 21:31:58 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53554 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751503AbdGRBb4 (ORCPT ); Mon, 17 Jul 2017 21:31:56 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7936D611B8 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sboyd@codeaurora.org Date: Mon, 17 Jul 2017 18:31:54 -0700 From: Stephen Boyd To: Julia Lawall Cc: Michael Turquette , keescook@chromium.org, kernel-janitors@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/11] clk: mmp: Drop unnecessary static Message-ID: <20170718013154.GB17424@codeaurora.org> References: <1500149266-32357-1-git-send-email-Julia.Lawall@lip6.fr> <1500149266-32357-2-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-2-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: 724 Lines: 39 On 07/15, 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 clk-next -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project