Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: 3c509: make the array if_names static const, makes object smaller

Don't populate the array if_names on the stack but instead it
static const. Makes the object code smaller by 99 bytes.

Before:
text data bss dec hex filename
27886 10752 672 39310 998e ./drivers/net/ethernet/3com/3c509.o

After:
text data bss dec hex filename
27723 10816 672 39211 992b ./drivers/net/ethernet/3com/3c509.o

(gcc version 10.2.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210801152650.146572-1-colin.king@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Colin Ian King and committed by
Jakub Kicinski
771edeab d5731f89

+3 -1
+3 -1
drivers/net/ethernet/3com/3c509.c
··· 514 514 { 515 515 struct el3_private *lp = netdev_priv(dev); 516 516 int err; 517 - const char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"}; 517 + static const char * const if_names[] = { 518 + "10baseT", "AUI", "undefined", "BNC" 519 + }; 518 520 519 521 spin_lock_init(&lp->lock); 520 522