diff options
author | Gustavo A. R. Silva <gustavo@embeddedor.com> | 2017-07-20 01:49:31 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2017-07-20 12:18:45 +0300 |
commit | 1d609dd32cd209f4643c7fd450f19d114cec0de7 (patch) | |
tree | d6b0df1f2ae5551db61362f14c0601d581b44e47 /drivers/bluetooth | |
parent | 37f5258d1cde34e73a5ce3dfe00a80274e299c72 (diff) | |
download | linux-1d609dd32cd209f4643c7fd450f19d114cec0de7.tar.xz |
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>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/btwilink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/bluetooth/btwilink.c b/drivers/bluetooth/btwilink.c index 85a3978b064f..0cdb8961e9a1 100644 --- a/drivers/bluetooth/btwilink.c +++ b/drivers/bluetooth/btwilink.c @@ -276,7 +276,7 @@ static int ti_st_send_frame(struct hci_dev *hdev, struct sk_buff *skb) static int bt_ti_probe(struct platform_device *pdev) { - static struct ti_st *hst; + struct ti_st *hst; struct hci_dev *hdev; int err; |