Skip to content

Commit 49e00b5

Browse files
t-8chBenjamin Tissoires
authored andcommitted
HID: dr: 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 00f6f65 commit 49e00b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hid/hid-dr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static inline int drff_init(struct hid_device *hid)
199199
#define PID0011_RDESC_ORIG_SIZE 101
200200

201201
/* Fixed report descriptor for PID 0x011 joystick */
202-
static __u8 pid0011_rdesc_fixed[] = {
202+
static const __u8 pid0011_rdesc_fixed[] = {
203203
0x05, 0x01, /* Usage Page (Desktop), */
204204
0x09, 0x04, /* Usage (Joystick), */
205205
0xA1, 0x01, /* Collection (Application), */
@@ -234,8 +234,8 @@ static const __u8 *dr_report_fixup(struct hid_device *hdev, __u8 *rdesc,
234234
switch (hdev->product) {
235235
case 0x0011:
236236
if (*rsize == PID0011_RDESC_ORIG_SIZE) {
237-
rdesc = pid0011_rdesc_fixed;
238237
*rsize = sizeof(pid0011_rdesc_fixed);
238+
return pid0011_rdesc_fixed;
239239
}
240240
break;
241241
}

0 commit comments

Comments
 (0)