nfc: s3fwrn5: make array match static const
authorColin Ian King <colin.king@canonical.com>
Tue, 19 Sep 2017 14:25:15 +0000 (15:25 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 6 Nov 2017 00:05:06 +0000 (01:05 +0100)
Don't populate the read-only array match on the stack, instead make
it static const.  Makes the object code smaller by over 310 bytes:

Before:
   text    data     bss     dec     hex filename
   8304    1084     128    9516    252c drivers/nfc/s3fwrn5/firmware.o

After:
   text    data     bss     dec     hex filename
   7894    1180     128    9202    23f2 drivers/nfc/s3fwrn5/firmware.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/s3fwrn5/firmware.c

index 38548bd970cd2aa738a916ab198ee3456b0e9cfe..b7828fb252f272da04e4845211d88a8d37764eb0 100644 (file)
@@ -336,7 +336,7 @@ static int s3fwrn5_fw_get_base_addr(
        struct s3fwrn5_fw_cmd_get_bootinfo_rsp *bootinfo, u32 *base_addr)
 {
        int i;
-       struct {
+       static const struct {
                u8 version[4];
                u32 base_addr;
        } match[] = {