From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965068AbdGTUrQ (ORCPT ); Thu, 20 Jul 2017 16:47:16 -0400 Received: from gateway22.websitewelcome.com ([192.185.46.225]:49952 "EHLO gateway22.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934949AbdGTUrP (ORCPT ); Thu, 20 Jul 2017 16:47:15 -0400 Subject: Re: [PATCH] bluetooth: btwilink: remove unnecessary static in bt_ti_probe() To: Marcel Holtmann References: <20170719224931.GA16225@embeddedgus> <04410763-BA78-422B-A4B3-B66D777E732F@holtmann.org> Cc: "Gustavo F. Padovan" , Johan Hedberg , "open list:BLUETOOTH DRIVERS" , linux-kernel@vger.kernel.org From: "Gustavo A. R. Silva" Message-ID: Date: Thu, 20 Jul 2017 15:47:09 -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: <04410763-BA78-422B-A4B3-B66D777E732F@holtmann.org> Content-Type: text/plain; charset=windows-1252; 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: 1dYILq-003WYc-L8 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.1.208]) [189.152.228.197]:50922 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 6 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 Hi Marcel, On 07/20/2017 04:20 AM, Marcel Holtmann wrote: > Hi Gustavo, > >> Remove unnecessary static on local variable hst. >> Such variable is initialized before being used, >> on every execution path throughout the function. >> 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 >> 4029 2528 128 6685 1a1d drivers/bluetooth/btwilink.o >> >> after: >> text data bss dec hex filename >> 4007 2472 64 6543 198f drivers/bluetooth/btwilink.o >> >> Signed-off-by: Gustavo A. R. Silva >> --- >> drivers/bluetooth/btwilink.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) > > patch has been applied to bluetooth-next tree. > Great, thanks! -- Gustavo A. R. Silva