diff options
author | Colin Ian King <colin.king@canonical.com> | 2021-08-01 17:26:50 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-08-03 00:02:04 +0200 |
commit | 771edeabcb9530e9e8020fb5f38111ba5dc1ad9c (patch) | |
tree | 6ee8c66bfdffa44d402dc9ab9745fea1e8e788c5 /drivers/net/ethernet/3com | |
parent | dpaa2-eth: make the array faf_bits static const, makes object smaller (diff) | |
download | linux-771edeabcb9530e9e8020fb5f38111ba5dc1ad9c.tar.xz linux-771edeabcb9530e9e8020fb5f38111ba5dc1ad9c.zip |
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>
Diffstat (limited to 'drivers/net/ethernet/3com')
-rw-r--r-- | drivers/net/ethernet/3com/3c509.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/3com/3c509.c b/drivers/net/ethernet/3com/3c509.c index 96cc5fc36eb5..df6927f66771 100644 --- a/drivers/net/ethernet/3com/3c509.c +++ b/drivers/net/ethernet/3com/3c509.c @@ -514,7 +514,9 @@ static int el3_common_init(struct net_device *dev) { struct el3_private *lp = netdev_priv(dev); int err; - const char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"}; + static const char * const if_names[] = { + "10baseT", "AUI", "undefined", "BNC" + }; spin_lock_init(&lp->lock); |