Skip to content

Commit 39d21e7

Browse files
Colin Ian KingJiri Kosina
authored andcommitted
HID: logitech-dj: make const array template static
Don't populate the array template on the stack but instead make it static. Makes the object code smaller by 10 bytes. Also reformat the declaration. Before: text data bss dec hex filename 29376 9360 128 38864 97d0 drivers/hid/hid-logitech-dj.o After: text data bss dec hex filename 29270 9456 128 38854 97c6 drivers/hid/hid-logitech-dj.o (gcc version 8.3.0, amd64) Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 423dfbc commit 39d21e7

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

drivers/hid/hid-logitech-dj.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,12 +1111,14 @@ static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev,
11111111

11121112
static int logi_dj_recv_query_hidpp_devices(struct dj_receiver_dev *djrcv_dev)
11131113
{
1114-
const u8 template[] = {REPORT_ID_HIDPP_SHORT,
1115-
HIDPP_RECEIVER_INDEX,
1116-
HIDPP_SET_REGISTER,
1117-
HIDPP_REG_CONNECTION_STATE,
1118-
HIDPP_FAKE_DEVICE_ARRIVAL,
1119-
0x00, 0x00};
1114+
static const u8 template[] = {
1115+
REPORT_ID_HIDPP_SHORT,
1116+
HIDPP_RECEIVER_INDEX,
1117+
HIDPP_SET_REGISTER,
1118+
HIDPP_REG_CONNECTION_STATE,
1119+
HIDPP_FAKE_DEVICE_ARRIVAL,
1120+
0x00, 0x00
1121+
};
11201122
u8 *hidpp_report;
11211123
int retval;
11221124

0 commit comments

Comments
 (0)