OSDN Git Service

brcmsmac: make array addr static const, makes object smaller
authorColin Ian King <colin.king@canonical.com>
Thu, 19 Aug 2021 12:55:52 +0000 (13:55 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Sat, 21 Aug 2021 19:20:17 +0000 (22:20 +0300)
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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210819125552.8888-1-colin.king@canonical.com
drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c

index 26de1bd..8ddfc3d 100644 (file)
@@ -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
        };