Skip to content

Commit

Permalink
HID: logitech-dj: make const array template static
Browse files Browse the repository at this point in the history
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 <colin.king@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Colin Ian King authored and Jiri Kosina committed May 22, 2019
1 parent 423dfbc commit 39d21e7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions drivers/hid/hid-logitech-dj.c
Original file line number Diff line number Diff line change
Expand Up @@ -1111,12 +1111,14 @@ static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev,

static int logi_dj_recv_query_hidpp_devices(struct dj_receiver_dev *djrcv_dev)
{
const u8 template[] = {REPORT_ID_HIDPP_SHORT,
HIDPP_RECEIVER_INDEX,
HIDPP_SET_REGISTER,
HIDPP_REG_CONNECTION_STATE,
HIDPP_FAKE_DEVICE_ARRIVAL,
0x00, 0x00};
static const u8 template[] = {
REPORT_ID_HIDPP_SHORT,
HIDPP_RECEIVER_INDEX,
HIDPP_SET_REGISTER,
HIDPP_REG_CONNECTION_STATE,
HIDPP_FAKE_DEVICE_ARRIVAL,
0x00, 0x00
};
u8 *hidpp_report;
int retval;

Expand Down

0 comments on commit 39d21e7

Please sign in to comment.