Skip to content

Commit 93fe07e

Browse files
GustavoARSilvadavem330
authored andcommitted
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>
1 parent f03b06f commit 93fe07e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/cavium/liquidio/lio_vf_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,10 +1663,10 @@ static int setup_io_queues(struct octeon_device *octeon_dev, int ifidx)
16631663
{
16641664
struct octeon_droq_ops droq_ops;
16651665
struct net_device *netdev;
1666-
static int cpu_id_modulus;
1666+
int cpu_id_modulus;
16671667
struct octeon_droq *droq;
16681668
struct napi_struct *napi;
1669-
static int cpu_id;
1669+
int cpu_id;
16701670
int num_tx_descs;
16711671
struct lio *lio;
16721672
int retval = 0;

0 commit comments

Comments
 (0)