* [PATCH] net: ethernet: ti: cpsw: make array stpa static const, makes object smaller
@ 2021-08-19 12:04 Colin King
2021-08-19 12:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-08-19 12:04 UTC (permalink / raw)
To: Grygorii Strashko, David S . Miller, Jakub Kicinski, linux-omap, netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Don't populate the array stpa on the stack but instead it
static const. Makes the object code smaller by 81 bytes:
Before:
text data bss dec hex filename
54993 17248 0 72241 11a31 ./drivers/net/ethernet/ti/cpsw_new.o
After:
text data bss dec hex filename
54784 17376 0 72160 119e0 ./drivers/net/ethernet/ti/cpsw_new.o
(gcc version 10.3.0)
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/ethernet/ti/cpsw_new.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ti/cpsw_new.c b/drivers/net/ethernet/ti/cpsw_new.c
index 85d05b9be2b8..534d39f729e2 100644
--- a/drivers/net/ethernet/ti/cpsw_new.c
+++ b/drivers/net/ethernet/ti/cpsw_new.c
@@ -502,7 +502,7 @@ static void cpsw_restore(struct cpsw_priv *priv)
static void cpsw_init_stp_ale_entry(struct cpsw_common *cpsw)
{
- char stpa[] = {0x01, 0x80, 0xc2, 0x0, 0x0, 0x0};
+ static const char stpa[] = {0x01, 0x80, 0xc2, 0x0, 0x0, 0x0};
cpsw_ale_add_mcast(cpsw->ale, stpa,
ALE_PORT_HOST, ALE_SUPER, 0,
--
2.32.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: ethernet: ti: cpsw: make array stpa static const, makes object smaller
2021-08-19 12:04 [PATCH] net: ethernet: ti: cpsw: make array stpa static const, makes object smaller Colin King
@ 2021-08-19 12:30 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-19 12:30 UTC (permalink / raw)
To: Colin King
Cc: grygorii.strashko, davem, kuba, linux-omap, netdev,
kernel-janitors, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Thu, 19 Aug 2021 13:04:43 +0100 you wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate the array stpa on the stack but instead it
> static const. Makes the object code smaller by 81 bytes:
>
> Before:
> text data bss dec hex filename
> 54993 17248 0 72241 11a31 ./drivers/net/ethernet/ti/cpsw_new.o
>
> [...]
Here is the summary with links:
- net: ethernet: ti: cpsw: make array stpa static const, makes object smaller
https://git.kernel.org/netdev/net-next/c/5c8a2bb48159
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-19 12:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 12:04 [PATCH] net: ethernet: ti: cpsw: make array stpa static const, makes object smaller Colin King
2021-08-19 12:30 ` patchwork-bot+netdevbpf
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).