Skip to content

Commit fe2199c

Browse files
Colin Ian KingJiri Kosina
authored andcommitted
HID: prodikeys: make array keys static const, makes object smaller
Don't populate the array keys on the stack but instead make it static const. Makes the object code smaller by 166 bytes. Before: text data bss dec hex filename 18931 5872 480 25283 62c3 drivers/hid/hid-prodikeys.o After: text data bss dec hex filename 18669 5968 480 25117 621d drivers/hid/hid-prodikeys.o (gcc version 9.2.1, amd64) Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent b3a81c7 commit fe2199c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hid/hid-prodikeys.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ static void pcmidi_setup_extra_keys(
516516
MY PICTURES => KEY_WORDPROCESSOR
517517
MY MUSIC=> KEY_SPREADSHEET
518518
*/
519-
unsigned int keys[] = {
519+
static const unsigned int keys[] = {
520520
KEY_FN,
521521
KEY_MESSENGER, KEY_CALENDAR,
522522
KEY_ADDRESSBOOK, KEY_DOCUMENTS,
@@ -532,7 +532,7 @@ static void pcmidi_setup_extra_keys(
532532
0
533533
};
534534

535-
unsigned int *pkeys = &keys[0];
535+
const unsigned int *pkeys = &keys[0];
536536
unsigned short i;
537537

538538
if (pm->ifnum != 1) /* only set up ONCE for interace 1 */

0 commit comments

Comments
 (0)