]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
liquidio: lio_vf_main: remove unnecessary static in setup_io_queues()
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Tue, 18 Jul 2017 20:50:15 +0000 (15:50 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Jul 2017 23:33:57 +0000 (16:33 -0700)
commit93fe07e52ea1218a78f3886d23479958e14a0eea
tree8436c3d41214ef98132831c5447236862e7cc6d9
parentf03b06f3bae893d0f4fbe7c41adc1d45016bb974
liquidio: lio_vf_main: remove unnecessary static in setup_io_queues()

Remove unnecessary static on local variables cpu_id_modulus and cpu_id.
Such variables are 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. Also, there is a significant difference in the bss segment.
This log is the output of the size command, before and after the code
change:

before:
   text    data     bss     dec     hex filename
  55656   10680     576   66912   10560 drivers/net/ethernet/cavium/liquidio/lio_vf_main.o

after:
   text    data     bss     dec     hex filename
  55796   10536     448   66780   104dc drivers/net/ethernet/cavium/liquidio/lio_vf_main.o

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c