LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] netdevsim: make array res_ids static const, makes object smaller
@ 2021-08-01  6:53 Colin King
  2021-08-02 16:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-08-01  6:53 UTC (permalink / raw)
  To: Jakub Kicinski, David S . Miller, netdev; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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

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

After:
   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 <colin.king@canonical.com>
---
 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[] = {
 		NSIM_RESOURCE_IPV4_FIB, NSIM_RESOURCE_IPV4_FIB_RULES,
 		NSIM_RESOURCE_IPV6_FIB, NSIM_RESOURCE_IPV6_FIB_RULES,
 		NSIM_RESOURCE_NEXTHOPS,
-- 
2.31.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] netdevsim: make array res_ids static const, makes object smaller
  2021-08-01  6:53 [PATCH] netdevsim: make array res_ids static const, makes object smaller Colin King
@ 2021-08-02 16:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-02 16:20 UTC (permalink / raw)
  To: Colin King; +Cc: kuba, davem, netdev, kernel-janitors, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Sun,  1 Aug 2021 07:53:28 +0100 you wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the array res_ids on the stack but instead it
> static const. Makes the object code smaller by 14 bytes.
> 
> Before:
>    text    data     bss     dec     hex filename
>   50833    8314     256   59403    e80b ./drivers/net/netdevsim/fib.o
> 
> [...]

Here is the summary with links:
  - netdevsim: make array res_ids static const, makes object smaller
    https://git.kernel.org/netdev/net-next/c/f36c82ac1b1b

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-02 16:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-01  6:53 [PATCH] netdevsim: make array res_ids static const, makes object smaller Colin King
2021-08-02 16:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox