HID: elan: Make array buf static, shrinks object size
authorColin Ian King <colin.king@canonical.com>
Fri, 25 Jan 2019 16:05:46 +0000 (16:05 +0000)
committerJiri Kosina <jkosina@suse.cz>
Mon, 28 Jan 2019 20:49:12 +0000 (21:49 +0100)
Don't populate the array buf on the stack but instead make it
static. Makes the object code smaller by 43 bytes:

Before:
   text    data     bss     dec     hex filename
   7769    1520       0    9289    2449 drivers/hid/hid-elan.o

After:
   text    data     bss     dec     hex filename
   7662    1584       0    9246    241e drivers/hid/hid-elan.o

(gcc version 8.2.0 x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-elan.c

index 0bfd6d1b44c143fce37aedf6977a529adfabfacf..1c62095cee9984070248a6148fab16eb41e6b919 100644 (file)
@@ -393,7 +393,7 @@ static int elan_start_multitouch(struct hid_device *hdev)
         * This byte sequence will enable multitouch mode and disable
         * mouse emulation
         */
-       const unsigned char buf[] = { 0x0D, 0x00, 0x03, 0x21, 0x00 };
+       static const unsigned char buf[] = { 0x0D, 0x00, 0x03, 0x21, 0x00 };
        unsigned char *dmabuf = kmemdup(buf, sizeof(buf), GFP_KERNEL);
 
        if (!dmabuf)