kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] brcmsmac: make array addr static const, makes object smaller
@ 2021-08-19 12:55 Colin King
  2021-08-21 19:20 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-08-19 12:55 UTC (permalink / raw)
  To: Arend van Spriel, Franky Lin, Hante Meuleman, Chi-hsien Lin,
	Wright Feng, Chung-hsien Hsu, Kalle Valo, David S . Miller,
	Jakub Kicinski, linux-wireless, brcm80211-dev-list.pdl,
	SHA-cyfmac-dev-list, netdev
  Cc: kernel-janitors

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

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

Before:
   text   data   bss     dec    hex filename
 176015  54652   128  230795  3858b .../broadcom/brcm80211/brcmsmac/main.o

After:
   text   data   bss     dec    hex filename
 175872  54716   128  230716  3853c .../broadcom/brcm80211/brcmsmac/main.o

(gcc version 10.3.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
index 26de1bd7fee9..8ddfc3d06687 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
@@ -704,7 +704,7 @@ static void brcms_c_write_inits(struct brcms_hardware *wlc_hw,
 static void brcms_c_write_mhf(struct brcms_hardware *wlc_hw, u16 *mhfs)
 {
 	u8 idx;
-	u16 addr[] = {
+	static const u16 addr[] = {
 		M_HOST_FLAGS1, M_HOST_FLAGS2, M_HOST_FLAGS3, M_HOST_FLAGS4,
 		M_HOST_FLAGS5
 	};
-- 
2.32.0


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

* Re: [PATCH] brcmsmac: make array addr static const, makes object smaller
  2021-08-19 12:55 [PATCH] brcmsmac: make array addr static const, makes object smaller Colin King
@ 2021-08-21 19:20 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2021-08-21 19:20 UTC (permalink / raw)
  To: Colin King
  Cc: Arend van Spriel, Franky Lin, Hante Meuleman, Chi-hsien Lin,
	Wright Feng, Chung-hsien Hsu, David S . Miller, Jakub Kicinski,
	linux-wireless, brcm80211-dev-list.pdl, SHA-cyfmac-dev-list,
	netdev, kernel-janitors

Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the array addr on the stack but instead it
> static const. Makes the object code smaller by 79 bytes:
> 
> Before:
>    text   data   bss     dec    hex filename
>  176015  54652   128  230795  3858b .../broadcom/brcm80211/brcmsmac/main.o
> 
> After:
>    text   data   bss     dec    hex filename
>  175872  54716   128  230716  3853c .../broadcom/brcm80211/brcmsmac/main.o
> 
> (gcc version 10.3.0)
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Patch applied to wireless-drivers-next.git, thanks.

0dc62413c882 brcmsmac: make array addr static const, makes object smaller

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210819125552.8888-1-colin.king@canonical.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2021-08-21 19:20 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:55 [PATCH] brcmsmac: make array addr static const, makes object smaller Colin King
2021-08-21 19:20 ` Kalle Valo

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).