Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752466AbdGLNN0 (ORCPT ); Wed, 12 Jul 2017 09:13:26 -0400 Received: from outbound1a.ore.mailhop.org ([54.213.22.21]:57720 "EHLO outbound1a.ore.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752039AbdGLNNR (ORCPT ); Wed, 12 Jul 2017 09:13:17 -0400 X-Greylist: delayed 972 seconds by postgrey-1.27 at vger.kernel.org; Wed, 12 Jul 2017 09:13:17 EDT X-MHO-User: 9d93b826-6701-11e7-bfd0-afd4446ba3af X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 173.50.81.193 X-Mail-Handler: DuoCircle Outbound SMTP X-DKIM: OpenDKIM Filter v2.6.8 io F1AA98010A Date: Wed, 12 Jul 2017 12:57:01 +0000 From: Jason Cooper To: "Gustavo A. R. Silva" Cc: Thomas Gleixner , Marc Zyngier , linux-kernel@vger.kernel.org Subject: Re: [PATCH] irqchip/gic/realview: remove unnecessary static in realview_gic_of_init() Message-ID: <20170712125701.GA921@io.lakedaemon.net> References: <20170704212621.GA4320@embeddedgus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170704212621.GA4320@embeddedgus> 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: 1264 Lines: 53 Hi Gustavo, On Tue, Jul 04, 2017 at 04:26:22PM -0500, Gustavo A. R. Silva wrote: > Remove unnecessary static on local variable _map_. > Such variable is initialized before being used, > on every execution path throughout the function. > The static has no benefit and, removing it reduces > the code size. > > 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; > > In the following log you can see the difference in the code size. Also, > notice that the bss segment size is reduced down to zero. This log is > the output of the size command, before and after the code change: > > before: > text data bss dec hex filename > 2187 272 64 2523 9db drivers/irqchip/irq-gic-realview.o > > after: > text data bss dec hex filename > 2171 216 0 2387 953 drivers/irqchip/irq-gic-realview.o > > Signed-off-by: Gustavo A. R. Silva Acked-by: Jason Cooper thx, Jason.