diff options
author | Colin Ian King <colin.king@canonical.com> | 2018-01-06 10:50:27 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2018-02-16 07:34:28 -0500 |
commit | b9ec7009298ee0e163339484992252d8dff636dc (patch) | |
tree | e1a9526926fe72afcf66a4fd235c8d18989120de /drivers/hid/hid-asus.c | |
parent | 183b6366cf473ff0e706a6751adc082faa44843d (diff) |
HID: asus: make array 'buf' static const
Don't populate the const read-only array 'buf' on the stack but instead
make it static. Makes the object code smaller by 26 bytes:
Before:
text data bss dec hex filename
14378 2384 64 16826 41ba linux/drivers/hid/hid-asus.o
After:
text data bss dec hex filename
14296 2440 64 16800 41a0 linux/drivers/hid/hid-asus.o
(gcc version 7.2.0 x86_64)
[jkosina@suse.cz: change commit message slightly]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-asus.c')
-rw-r--r-- | drivers/hid/hid-asus.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c index 88b9703318e4..d92f8aa2876b 100644 --- a/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c | |||
@@ -570,7 +570,9 @@ static int asus_input_mapping(struct hid_device *hdev, | |||
570 | static int asus_start_multitouch(struct hid_device *hdev) | 570 | static int asus_start_multitouch(struct hid_device *hdev) |
571 | { | 571 | { |
572 | int ret; | 572 | int ret; |
573 | const unsigned char buf[] = { FEATURE_REPORT_ID, 0x00, 0x03, 0x01, 0x00 }; | 573 | static const unsigned char buf[] = { |
574 | FEATURE_REPORT_ID, 0x00, 0x03, 0x01, 0x00 | ||
575 | }; | ||
574 | unsigned char *dmabuf = kmemdup(buf, sizeof(buf), GFP_KERNEL); | 576 | unsigned char *dmabuf = kmemdup(buf, sizeof(buf), GFP_KERNEL); |
575 | 577 | ||
576 | if (!dmabuf) { | 578 | if (!dmabuf) { |