]> git.baikalelectronics.ru Git - kernel.git/commit
wireless: airo: remove unnecessary static in writerids()
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Tue, 18 Jul 2017 20:37:11 +0000 (15:37 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Jul 2017 23:33:57 +0000 (16:33 -0700)
commit1a9b5cd131dd15560606b589c4156da71dc95947
treecd243c1a4b8a742c8e88afe2b50ba928ec59f801
parent2b9b82ed07198f9a34e0f355c147deebc239466a
wireless: airo: remove unnecessary static in writerids()

Remove unnecessary static on local function pointer _writer_.
Such pointer 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 a significant 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
 113797   19152    1216  134165   20c15 drivers/net/wireless/cisco/airo.o

after:
   text    data     bss     dec     hex filename
 113881   19096    1152  134129   20bf1 drivers/net/wireless/cisco/airo.o

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wireless/cisco/airo.c