Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: lg-g15: make a const array static, makes object smaller

Don't populate the const array led_names on the stack but instead make
it static. Makes the object code smaller by 79 bytes:

Before:
text data bss dec hex filename
19686 7952 256 27894 6cf6 drivers/hid/hid-lg-g15.o

After:
text data bss dec hex filename
19543 8016 256 27815 6ca7 drivers/hid/hid-lg-g15.o

(gcc version 10.2.0)

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

authored by

Colin Ian King and committed by
Jiri Kosina
4d300833 e037acf0

+1 -1
+1 -1
drivers/hid/hid-lg-g15.c
··· 647 647 648 648 static int lg_g15_register_led(struct lg_g15_data *g15, int i) 649 649 { 650 - const char * const led_names[] = { 650 + static const char * const led_names[] = { 651 651 "g15::kbd_backlight", 652 652 "g15::lcd_backlight", 653 653 "g15::macro_preset1",