From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752101AbdHCWHi (ORCPT ); Thu, 3 Aug 2017 18:07:38 -0400 Received: from gateway30.websitewelcome.com ([192.185.146.7]:11889 "EHLO gateway30.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752048AbdHCWHd (ORCPT ); Thu, 3 Aug 2017 18:07:33 -0400 X-Greylist: delayed 1246 seconds by postgrey-1.27 at vger.kernel.org; Thu, 03 Aug 2017 18:07:33 EDT Subject: Re: [PATCH] soc: versatile: remove unnecessary static in realview_soc_probe() To: Linus Walleij References: <20170719224059.GA14741@embeddedgus> Cc: "linux-kernel@vger.kernel.org" From: "Gustavo A. R. Silva" Message-ID: <7f849143-a1ed-c827-fbd2-dbe5c907cf9e@embeddedor.com> Date: Thu, 3 Aug 2017 16:46:44 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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: 1ddNx8-001bCg-Qc X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.1.208]) [189.152.228.197]:34530 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 4 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 On 08/02/2017 06:59 AM, Linus Walleij wrote: > On Thu, Jul 20, 2017 at 12:40 AM, Gustavo A. R. Silva > wrote: > >> Remove unnecessary static on local variables syscon_regmap. >> Such variables are initialized before being used, on every >> execution path throughout the functions. The static has no >> benefit and, removing it reduces the object file 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 object file size. >> This log is the output of the size command, before and after the code >> change: >> >> before: >> text data bss dec hex filename >> 3339 2104 128 5571 15c3 drivers/soc/versatile/soc-realview.o >> >> after: >> text data bss dec hex filename >> 3321 2048 64 5433 1539 drivers/soc/versatile/soc-realview.o >> >> Signed-off-by: Gustavo A. R. Silva > > Acked-by: Linus Walleij > > You probably want to funnel this patch through the ARM SoC tree. > > (If nothing else works, send as separate patch to arm@kernel.org) > OK, I'll do that. I'll add your ACK and CC you. Thanks! -- Gustavo A. R. Silva