Skip to content

Commit c06df4c

Browse files
t-8chBenjamin Tissoires
authored andcommitted
HID: xiaomi: constify fixed up report descriptor
Now that the HID core can handle const report descriptors, constify them where possible. Signed-off-by: Thomas Weißschuh <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent d8b21af commit c06df4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hid/hid-xiaomi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/* Fixed Mi Silent Mouse report descriptor */
1515
/* Button's Usage Maximum changed from 3 to 5 to make side buttons work */
1616
#define MI_SILENT_MOUSE_ORIG_RDESC_LENGTH 87
17-
static __u8 mi_silent_mouse_rdesc_fixed[] = {
17+
static const __u8 mi_silent_mouse_rdesc_fixed[] = {
1818
0x05, 0x01, /* Usage Page (Desktop), */
1919
0x09, 0x02, /* Usage (Mouse), */
2020
0xA1, 0x01, /* Collection (Application), */
@@ -68,8 +68,8 @@ static const __u8 *xiaomi_report_fixup(struct hid_device *hdev, __u8 *rdesc,
6868
case USB_DEVICE_ID_MI_SILENT_MOUSE:
6969
if (*rsize == MI_SILENT_MOUSE_ORIG_RDESC_LENGTH) {
7070
hid_info(hdev, "fixing up Mi Silent Mouse report descriptor\n");
71-
rdesc = mi_silent_mouse_rdesc_fixed;
7271
*rsize = sizeof(mi_silent_mouse_rdesc_fixed);
72+
return mi_silent_mouse_rdesc_fixed;
7373
}
7474
break;
7575
}

0 commit comments

Comments
 (0)