diff options
author | Colin Ian King <colin.king@canonical.com> | 2019-09-05 18:54:06 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2019-10-01 16:21:04 +0200 |
commit | fe2199cfd1516e90e03c033c52c9a28da09d9986 (patch) | |
tree | c9a48de7f4bd02608f01094d0df450767ac0fafb /drivers/hid/hid-prodikeys.c | |
parent | HID: fix error message in hid_open_report() (diff) | |
download | linux-fe2199cfd1516e90e03c033c52c9a28da09d9986.tar.xz linux-fe2199cfd1516e90e03c033c52c9a28da09d9986.zip |
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 <colin.king@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-prodikeys.c')
-rw-r--r-- | drivers/hid/hid-prodikeys.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hid/hid-prodikeys.c b/drivers/hid/hid-prodikeys.c index 5a3b3d974d84..2666af02d5c1 100644 --- a/drivers/hid/hid-prodikeys.c +++ b/drivers/hid/hid-prodikeys.c @@ -516,7 +516,7 @@ static void pcmidi_setup_extra_keys( MY PICTURES => KEY_WORDPROCESSOR MY MUSIC=> KEY_SPREADSHEET */ - unsigned int keys[] = { + static const unsigned int keys[] = { KEY_FN, KEY_MESSENGER, KEY_CALENDAR, KEY_ADDRESSBOOK, KEY_DOCUMENTS, @@ -532,7 +532,7 @@ static void pcmidi_setup_extra_keys( 0 }; - unsigned int *pkeys = &keys[0]; + const unsigned int *pkeys = &keys[0]; unsigned short i; if (pm->ifnum != 1) /* only set up ONCE for interace 1 */ |