From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: "Gustavo F. Padovan" <gustavo@padovan.org>,
Johan Hedberg <johan.hedberg@gmail.com>,
"open list:BLUETOOTH DRIVERS" <linux-bluetooth@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bluetooth: btwilink: remove unnecessary static in bt_ti_probe()
Date: Thu, 20 Jul 2017 15:47:09 -0500 [thread overview]
Message-ID: <c435b571-b2c7-d9fd-94af-62a318edb2d4@embeddedor.com> (raw)
In-Reply-To: <04410763-BA78-422B-A4B3-B66D777E732F@holtmann.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 <gustavo@embeddedor.com>
>> ---
>> 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
prev parent reply other threads:[~2017-07-20 20:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-19 22:49 [PATCH] bluetooth: btwilink: remove unnecessary static in bt_ti_probe() Gustavo A. R. Silva
2017-07-20 9:20 ` Marcel Holtmann
2017-07-20 20:47 ` Gustavo A. R. Silva [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c435b571-b2c7-d9fd-94af-62a318edb2d4@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=gustavo@padovan.org \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox