ssb: make array pwr_info_offset static const, makes object smaller
authorColin Ian King <colin.king@canonical.com>
Fri, 6 Sep 2019 15:40:53 +0000 (16:40 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 13 Sep 2019 14:23:18 +0000 (17:23 +0300)
Don't populate the array pwr_info_offset on the stack but instead make it
static const. Makes the object code smaller by 207 bytes.

Before:
   text    data     bss     dec     hex filename
  26066    3000      64   29130    71ca drivers/ssb/pci.o

After:
   text    data     bss     dec     hex filename
  25763    3096      64   28923    70fb drivers/ssb/pci.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Michael Büsch <m@bues.ch>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/ssb/pci.c

index da2d2ab8104d38e4277e3dcbb4a74bac7a012175..7c3ae52f2b15a9352c0951fc0c62873490645567 100644 (file)
@@ -595,7 +595,7 @@ static void sprom_extract_r8(struct ssb_sprom *out, const u16 *in)
 {
        int i;
        u16 o;
-       u16 pwr_info_offset[] = {
+       static const u16 pwr_info_offset[] = {
                SSB_SROM8_PWR_INFO_CORE0, SSB_SROM8_PWR_INFO_CORE1,
                SSB_SROM8_PWR_INFO_CORE2, SSB_SROM8_PWR_INFO_CORE3
        };