From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755037AbdGSWjL (ORCPT ); Wed, 19 Jul 2017 18:39:11 -0400 Received: from gateway24.websitewelcome.com ([192.185.51.202]:47601 "EHLO gateway24.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751911AbdGSWjK (ORCPT ); Wed, 19 Jul 2017 18:39:10 -0400 Date: Wed, 19 Jul 2017 17:39:08 -0500 From: "Gustavo A. R. Silva" To: Linus Walleij Cc: linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] soc: integrator: remove unnecessary static in integrator_soc_init() Message-ID: <20170719223908.GA14716@embeddedgus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.152.228.197 X-Exim-ID: 1dXxcb-001voo-5i X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.152.228.197]:60402 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 7 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove unnecessary static on local variable syscon_regmap. Such variables are initialized before being used, on every execution path throughout the functions. So, the static has no benefit. This issue was detected using Coccinelle and the following semantic patch: @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: Gustavo A. R. Silva --- drivers/soc/versatile/soc-integrator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/versatile/soc-integrator.c b/drivers/soc/versatile/soc-integrator.c index a5d7d39..e45638a 100644 --- a/drivers/soc/versatile/soc-integrator.c +++ b/drivers/soc/versatile/soc-integrator.c @@ -102,7 +102,7 @@ static struct device_attribute integrator_build_attr = static int __init integrator_soc_init(void) { - static struct regmap *syscon_regmap; + struct regmap *syscon_regmap; struct soc_device *soc_dev; struct soc_device_attribute *soc_dev_attr; struct device_node *np; -- 2.5.0