Netdev Archive on
help / color / mirror / Atom feed
From: Colin King <>
To: Jakub Kicinski <>,
	"David S . Miller" <>,
Subject: [PATCH] netdevsim: make array res_ids static const, makes object smaller
Date: Sun,  1 Aug 2021 07:53:28 +0100	[thread overview]
Message-ID: <> (raw)

From: Colin Ian King <>

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

   text    data     bss     dec     hex filename
  50833    8314     256   59403    e80b ./drivers/net/netdevsim/fib.o

   text    data     bss     dec     hex filename
  50755    8378     256   59389    e7fd ./drivers/net/netdevsim/fib.o

(gcc version 10.2.0)

Signed-off-by: Colin Ian King <>
 drivers/net/netdevsim/fib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib.c
index 213d3e5056c8..4300261e2f9e 100644
--- a/drivers/net/netdevsim/fib.c
+++ b/drivers/net/netdevsim/fib.c
@@ -1441,7 +1441,7 @@ static u64 nsim_fib_nexthops_res_occ_get(void *priv)
 static void nsim_fib_set_max_all(struct nsim_fib_data *data,
 				 struct devlink *devlink)
-	enum nsim_resource_id res_ids[] = {
+	static const enum nsim_resource_id res_ids[] = {

             reply	other threads:[~2021-08-01  6:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-01  6:53 Colin King [this message]
2021-08-02 16:20 ` [PATCH] netdevsim: make array res_ids static const, makes object smaller patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).