]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: btwilink: remove unnecessary static in bt_ti_probe()
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Wed, 19 Jul 2017 22:49:31 +0000 (17:49 -0500)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 20 Jul 2017 09:18:45 +0000 (11:18 +0200)
commit0394315288f12c40e6290db635eea285e3c38294
treed6b0df1f2ae5551db61362f14c0601d581b44e47
parentde2c68268675509e472d2e03ad8603f3fcbe8db9
Bluetooth: btwilink: remove unnecessary static in bt_ti_probe()

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>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/btwilink.c