mt76: make const array 'data' static, shrinks object size
authorColin Ian King <colin.king@canonical.com>
Sun, 30 Dec 2018 13:26:40 +0000 (13:26 +0000)
committerFelix Fietkau <nbd@nbd.name>
Fri, 11 Jan 2019 14:10:19 +0000 (15:10 +0100)
Don't populate the const array 'data' on the stack but instead
make it static. Makes the object code smaller by 78 bytes:

Before:
   text    data     bss     dec     hex filename
   5438    1080       0    6518    1976 mediatek/mt76/mt76x2/usb_mcu.o

After:
   text    data     bss     dec     hex filename
   5296    1144       0    6440    1928 mediatek/mt76/mt76x2/usb_mcu.o

(gcc version 8.2.0 x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76x2/usb_mcu.c

index 45a95ee..152d41f 100644 (file)
@@ -39,7 +39,7 @@ static void mt76x2u_mcu_load_ivb(struct mt76x02_dev *dev)
 static void mt76x2u_mcu_enable_patch(struct mt76x02_dev *dev)
 {
        struct mt76_usb *usb = &dev->mt76.usb;
-       const u8 data[] = {
+       static const u8 data[] = {
                0x6f, 0xfc, 0x08, 0x01,
                0x20, 0x04, 0x00, 0x00,
                0x00, 0x09, 0x00,