Skip to content

Commit b9ec700

Browse files
Colin Ian KingJiri Kosina
authored andcommitted
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) [[email protected]: change commit message slightly] Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 183b636 commit b9ec700

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/hid/hid-asus.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,9 @@ static int asus_input_mapping(struct hid_device *hdev,
570570
static int asus_start_multitouch(struct hid_device *hdev)
571571
{
572572
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+
};
574576
unsigned char *dmabuf = kmemdup(buf, sizeof(buf), GFP_KERNEL);
575577

576578
if (!dmabuf) {

0 commit comments

Comments
 (0)