Skip to content

Commit 24b3c51

Browse files
t-8chBenjamin Tissoires
authored andcommitted
HID: waltop: 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 d4781a2 commit 24b3c51

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

drivers/hid/hid-waltop.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#define SLIM_TABLET_5_8_INCH_RDESC_ORIG_SIZE 222
4444

4545
/* Fixed Slim Tablet 5.8 inch descriptor */
46-
static __u8 slim_tablet_5_8_inch_rdesc_fixed[] = {
46+
static const __u8 slim_tablet_5_8_inch_rdesc_fixed[] = {
4747
0x05, 0x0D, /* Usage Page (Digitizer), */
4848
0x09, 0x02, /* Usage (Pen), */
4949
0xA1, 0x01, /* Collection (Application), */
@@ -94,7 +94,7 @@ static __u8 slim_tablet_5_8_inch_rdesc_fixed[] = {
9494
#define SLIM_TABLET_12_1_INCH_RDESC_ORIG_SIZE 269
9595

9696
/* Fixed Slim Tablet 12.1 inch descriptor */
97-
static __u8 slim_tablet_12_1_inch_rdesc_fixed[] = {
97+
static const __u8 slim_tablet_12_1_inch_rdesc_fixed[] = {
9898
0x05, 0x0D, /* Usage Page (Digitizer), */
9999
0x09, 0x02, /* Usage (Pen), */
100100
0xA1, 0x01, /* Collection (Application), */
@@ -145,7 +145,7 @@ static __u8 slim_tablet_12_1_inch_rdesc_fixed[] = {
145145
#define Q_PAD_RDESC_ORIG_SIZE 241
146146

147147
/* Fixed Q Pad descriptor */
148-
static __u8 q_pad_rdesc_fixed[] = {
148+
static const __u8 q_pad_rdesc_fixed[] = {
149149
0x05, 0x0D, /* Usage Page (Digitizer), */
150150
0x09, 0x02, /* Usage (Pen), */
151151
0xA1, 0x01, /* Collection (Application), */
@@ -198,7 +198,7 @@ static __u8 q_pad_rdesc_fixed[] = {
198198
/*
199199
* Fixed report descriptor for tablet with PID 0038.
200200
*/
201-
static __u8 pid_0038_rdesc_fixed[] = {
201+
static const __u8 pid_0038_rdesc_fixed[] = {
202202
0x05, 0x0D, /* Usage Page (Digitizer), */
203203
0x09, 0x02, /* Usage (Pen), */
204204
0xA1, 0x01, /* Collection (Application), */
@@ -249,7 +249,7 @@ static __u8 pid_0038_rdesc_fixed[] = {
249249
#define MEDIA_TABLET_10_6_INCH_RDESC_ORIG_SIZE 300
250250

251251
/* Fixed Media Tablet 10.6 inch descriptor */
252-
static __u8 media_tablet_10_6_inch_rdesc_fixed[] = {
252+
static const __u8 media_tablet_10_6_inch_rdesc_fixed[] = {
253253
0x05, 0x0D, /* Usage Page (Digitizer), */
254254
0x09, 0x02, /* Usage (Pen), */
255255
0xA1, 0x01, /* Collection (Application), */
@@ -362,7 +362,7 @@ static __u8 media_tablet_10_6_inch_rdesc_fixed[] = {
362362
#define MEDIA_TABLET_14_1_INCH_RDESC_ORIG_SIZE 309
363363

364364
/* Fixed Media Tablet 14.1 inch descriptor */
365-
static __u8 media_tablet_14_1_inch_rdesc_fixed[] = {
365+
static const __u8 media_tablet_14_1_inch_rdesc_fixed[] = {
366366
0x05, 0x0D, /* Usage Page (Digitizer), */
367367
0x09, 0x02, /* Usage (Pen), */
368368
0xA1, 0x01, /* Collection (Application), */
@@ -473,7 +473,7 @@ static __u8 media_tablet_14_1_inch_rdesc_fixed[] = {
473473
#define SIRIUS_BATTERY_FREE_TABLET_RDESC_ORIG_SIZE 335
474474

475475
/* Fixed Sirius Battery Free Tablet descriptor */
476-
static __u8 sirius_battery_free_tablet_rdesc_fixed[] = {
476+
static const __u8 sirius_battery_free_tablet_rdesc_fixed[] = {
477477
0x05, 0x0D, /* Usage Page (Digitizer), */
478478
0x09, 0x02, /* Usage (Pen), */
479479
0xA1, 0x01, /* Collection (Application), */
@@ -605,44 +605,44 @@ static const __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc,
605605
switch (hdev->product) {
606606
case USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH:
607607
if (*rsize == SLIM_TABLET_5_8_INCH_RDESC_ORIG_SIZE) {
608-
rdesc = slim_tablet_5_8_inch_rdesc_fixed;
609608
*rsize = sizeof(slim_tablet_5_8_inch_rdesc_fixed);
609+
return slim_tablet_5_8_inch_rdesc_fixed;
610610
}
611611
break;
612612
case USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH:
613613
if (*rsize == SLIM_TABLET_12_1_INCH_RDESC_ORIG_SIZE) {
614-
rdesc = slim_tablet_12_1_inch_rdesc_fixed;
615614
*rsize = sizeof(slim_tablet_12_1_inch_rdesc_fixed);
615+
return slim_tablet_12_1_inch_rdesc_fixed;
616616
}
617617
break;
618618
case USB_DEVICE_ID_WALTOP_Q_PAD:
619619
if (*rsize == Q_PAD_RDESC_ORIG_SIZE) {
620-
rdesc = q_pad_rdesc_fixed;
621620
*rsize = sizeof(q_pad_rdesc_fixed);
621+
return q_pad_rdesc_fixed;
622622
}
623623
break;
624624
case USB_DEVICE_ID_WALTOP_PID_0038:
625625
if (*rsize == PID_0038_RDESC_ORIG_SIZE) {
626-
rdesc = pid_0038_rdesc_fixed;
627626
*rsize = sizeof(pid_0038_rdesc_fixed);
627+
return pid_0038_rdesc_fixed;
628628
}
629629
break;
630630
case USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH:
631631
if (*rsize == MEDIA_TABLET_10_6_INCH_RDESC_ORIG_SIZE) {
632-
rdesc = media_tablet_10_6_inch_rdesc_fixed;
633632
*rsize = sizeof(media_tablet_10_6_inch_rdesc_fixed);
633+
return media_tablet_10_6_inch_rdesc_fixed;
634634
}
635635
break;
636636
case USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH:
637637
if (*rsize == MEDIA_TABLET_14_1_INCH_RDESC_ORIG_SIZE) {
638-
rdesc = media_tablet_14_1_inch_rdesc_fixed;
639638
*rsize = sizeof(media_tablet_14_1_inch_rdesc_fixed);
639+
return media_tablet_14_1_inch_rdesc_fixed;
640640
}
641641
break;
642642
case USB_DEVICE_ID_WALTOP_SIRIUS_BATTERY_FREE_TABLET:
643643
if (*rsize == SIRIUS_BATTERY_FREE_TABLET_RDESC_ORIG_SIZE) {
644-
rdesc = sirius_battery_free_tablet_rdesc_fixed;
645644
*rsize = sizeof(sirius_battery_free_tablet_rdesc_fixed);
645+
return sirius_battery_free_tablet_rdesc_fixed;
646646
}
647647
break;
648648
}

0 commit comments

Comments
 (0)