Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

HID: change return type of report_fixup() to const

By allowing the drivers to return a "const *" they can constify their
static report arrays.
This makes it clear to driver authors that the HID core will not modify
those reports and they can be reused for multiple devices.
Furthermore security is slightly improved as those reports are protected
against accidental or malicious modifications.

[bentiss: fixup hid-cougar.c and hid-multitouch.c for latest version of
the master branch]

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://patch.msgid.link/20240803-hid-const-fixup-v2-6-f53d7a7b29d8@weissschuh.net
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>

authored by

Thomas Weißschuh and committed by
Benjamin Tissoires
fe73965d 3593630c

+68 -68
+1 -1
drivers/hid/hid-apple.c
··· 620 620 * MacBook JIS keyboard has wrong logical maximum 621 621 * Magic Keyboard JIS has wrong logical maximum 622 622 */ 623 - static __u8 *apple_report_fixup(struct hid_device *hdev, __u8 *rdesc, 623 + static const __u8 *apple_report_fixup(struct hid_device *hdev, __u8 *rdesc, 624 624 unsigned int *rsize) 625 625 { 626 626 struct apple_sc *asc = hid_get_drvdata(hdev);
+1 -1
drivers/hid/hid-asus.c
··· 1119 1119 0x2A, 0xFF, 0x00, /* Usage Maximum (0xFF) */ 1120 1120 }; 1121 1121 1122 - static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc, 1122 + static const __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc, 1123 1123 unsigned int *rsize) 1124 1124 { 1125 1125 struct asus_drvdata *drvdata = hid_get_drvdata(hdev);
+1 -1
drivers/hid/hid-aureal.c
··· 18 18 19 19 #include "hid-ids.h" 20 20 21 - static __u8 *aureal_report_fixup(struct hid_device *hdev, __u8 *rdesc, 21 + static const __u8 *aureal_report_fixup(struct hid_device *hdev, __u8 *rdesc, 22 22 unsigned int *rsize) 23 23 { 24 24 if (*rsize >= 54 && rdesc[52] == 0x25 && rdesc[53] == 0x01) {
+1 -1
drivers/hid/hid-bigbenff.c
··· 464 464 return error; 465 465 } 466 466 467 - static __u8 *bigben_report_fixup(struct hid_device *hid, __u8 *rdesc, 467 + static const __u8 *bigben_report_fixup(struct hid_device *hid, __u8 *rdesc, 468 468 unsigned int *rsize) 469 469 { 470 470 if (*rsize == PID0902_RDESC_ORIG_SIZE) {
+1 -1
drivers/hid/hid-cherry.c
··· 22 22 * Cherry Cymotion keyboard have an invalid HID report descriptor, 23 23 * that needs fixing before we can parse it. 24 24 */ 25 - static __u8 *ch_report_fixup(struct hid_device *hdev, __u8 *rdesc, 25 + static const __u8 *ch_report_fixup(struct hid_device *hdev, __u8 *rdesc, 26 26 unsigned int *rsize) 27 27 { 28 28 if (*rsize >= 18 && rdesc[11] == 0x3c && rdesc[12] == 0x02) {
+2 -2
drivers/hid/hid-chicony.c
··· 88 88 return 1; 89 89 } 90 90 91 - static __u8 *ch_switch12_report_fixup(struct hid_device *hdev, __u8 *rdesc, 92 - unsigned int *rsize) 91 + static const __u8 *ch_switch12_report_fixup(struct hid_device *hdev, 92 + __u8 *rdesc, unsigned int *rsize) 93 93 { 94 94 struct usb_interface *intf = to_usb_interface(hdev->dev.parent); 95 95
+1 -1
drivers/hid/hid-cmedia.c
··· 199 199 .input_mapping = cmhid_input_mapping, 200 200 }; 201 201 202 - static __u8 *cmhid_hs100b_report_fixup(struct hid_device *hid, __u8 *rdesc, 202 + static const __u8 *cmhid_hs100b_report_fixup(struct hid_device *hid, __u8 *rdesc, 203 203 unsigned int *rsize) 204 204 { 205 205 if (*rsize == HS100B_RDESC_ORIG_SIZE) {
+2 -2
drivers/hid/hid-corsair.c
··· 690 690 * - USB ID 1b1c:1b3e, sold as Scimitar RGB Pro Gaming mouse 691 691 */ 692 692 693 - static __u8 *corsair_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, 694 - unsigned int *rsize) 693 + static const __u8 *corsair_mouse_report_fixup(struct hid_device *hdev, 694 + __u8 *rdesc, unsigned int *rsize) 695 695 { 696 696 struct usb_interface *intf = to_usb_interface(hdev->dev.parent); 697 697
+2 -2
drivers/hid/hid-cougar.c
··· 103 103 /* 104 104 * Constant-friendly rdesc fixup for mouse interface 105 105 */ 106 - static __u8 *cougar_report_fixup(struct hid_device *hdev, __u8 *rdesc, 107 - unsigned int *rsize) 106 + static const __u8 *cougar_report_fixup(struct hid_device *hdev, __u8 *rdesc, 107 + unsigned int *rsize) 108 108 { 109 109 if (*rsize >= 117 && rdesc[2] == 0x09 && rdesc[3] == 0x02 && 110 110 (rdesc[115] | rdesc[116] << 8) >= HID_MAX_USAGES) {
+1 -1
drivers/hid/hid-cypress.c
··· 67 67 return rdesc; 68 68 } 69 69 70 - static __u8 *cp_report_fixup(struct hid_device *hdev, __u8 *rdesc, 70 + static const __u8 *cp_report_fixup(struct hid_device *hdev, __u8 *rdesc, 71 71 unsigned int *rsize) 72 72 { 73 73 unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);
+2 -2
drivers/hid/hid-dr.c
··· 228 228 0xC0 /* End Collection */ 229 229 }; 230 230 231 - static __u8 *dr_report_fixup(struct hid_device *hdev, __u8 *rdesc, 232 - unsigned int *rsize) 231 + static const __u8 *dr_report_fixup(struct hid_device *hdev, __u8 *rdesc, 232 + unsigned int *rsize) 233 233 { 234 234 switch (hdev->product) { 235 235 case 0x0011:
+1 -1
drivers/hid/hid-elecom.c
··· 53 53 rdesc[padding_bit + 1] = MOUSE_BUTTONS_MAX - nbuttons; 54 54 } 55 55 56 - static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc, 56 + static const __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc, 57 57 unsigned int *rsize) 58 58 { 59 59 switch (hdev->product) {
+1 -1
drivers/hid/hid-gembird.c
··· 57 57 0x81, 0x02, /* Input (Data,Var,Abs) */ 58 58 }; 59 59 60 - static __u8 *gembird_report_fixup(struct hid_device *hdev, __u8 *rdesc, 60 + static const __u8 *gembird_report_fixup(struct hid_device *hdev, __u8 *rdesc, 61 61 unsigned int *rsize) 62 62 { 63 63 __u8 *new_rdesc;
+1 -1
drivers/hid/hid-glorious.c
··· 26 26 * keyboard HID report, causing keycodes to be misinterpreted. 27 27 * Fix this by setting Usage Minimum to 0 in that report. 28 28 */ 29 - static __u8 *glorious_report_fixup(struct hid_device *hdev, __u8 *rdesc, 29 + static const __u8 *glorious_report_fixup(struct hid_device *hdev, __u8 *rdesc, 30 30 unsigned int *rsize) 31 31 { 32 32 if (*rsize == 213 &&
+1 -1
drivers/hid/hid-holtek-kbd.c
··· 102 102 0xC0, /* End Collection */ 103 103 }; 104 104 105 - static __u8 *holtek_kbd_report_fixup(struct hid_device *hdev, __u8 *rdesc, 105 + static const __u8 *holtek_kbd_report_fixup(struct hid_device *hdev, __u8 *rdesc, 106 106 unsigned int *rsize) 107 107 { 108 108 struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
+2 -2
drivers/hid/hid-holtek-mouse.c
··· 29 29 * - USB ID 04d9:a0c2, sold as ETEKCITY Scroll T-140 Gaming Mouse 30 30 */ 31 31 32 - static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, 33 - unsigned int *rsize) 32 + static const __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, 33 + __u8 *rdesc, unsigned int *rsize) 34 34 { 35 35 struct usb_interface *intf = to_usb_interface(hdev->dev.parent); 36 36
+1 -1
drivers/hid/hid-ite.c
··· 13 13 14 14 #define QUIRK_TOUCHPAD_ON_OFF_REPORT BIT(0) 15 15 16 - static __u8 *ite_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) 16 + static const __u8 *ite_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) 17 17 { 18 18 unsigned long quirks = (unsigned long)hid_get_drvdata(hdev); 19 19
+1 -1
drivers/hid/hid-keytouch.c
··· 24 24 0x26, 0xff, 0x00, 0x05, 0x07, 0x19, 0x00, 0x2a, 0xff, 0x00, 0x81, 0x00, 0xc0 25 25 }; 26 26 27 - static __u8 *keytouch_report_fixup(struct hid_device *hdev, __u8 *rdesc, 27 + static const __u8 *keytouch_report_fixup(struct hid_device *hdev, __u8 *rdesc, 28 28 unsigned int *rsize) 29 29 { 30 30 hid_info(hdev, "fixing up Keytouch IEC report descriptor\n");
+1 -1
drivers/hid/hid-kye.c
··· 466 466 return rdesc; 467 467 } 468 468 469 - static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, 469 + static const __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, 470 470 unsigned int *rsize) 471 471 { 472 472 switch (hdev->product) {
+1 -1
drivers/hid/hid-lenovo.c
··· 133 133 0x81, 0x01, /* Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position) */ 134 134 }; 135 135 136 - static __u8 *lenovo_report_fixup(struct hid_device *hdev, __u8 *rdesc, 136 + static const __u8 *lenovo_report_fixup(struct hid_device *hdev, __u8 *rdesc, 137 137 unsigned int *rsize) 138 138 { 139 139 switch (hdev->product) {
+1 -1
drivers/hid/hid-lg.c
··· 427 427 * above the logical maximum described in descriptor. This extends 428 428 * the original value of 0x28c of logical maximum to 0x104d 429 429 */ 430 - static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc, 430 + static const __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc, 431 431 unsigned int *rsize) 432 432 { 433 433 struct lg_drv_data *drv_data = hid_get_drvdata(hdev);
+2 -2
drivers/hid/hid-logitech-hidpp.c
··· 3767 3767 /* Generic HID++ devices */ 3768 3768 /* -------------------------------------------------------------------------- */ 3769 3769 3770 - static u8 *hidpp_report_fixup(struct hid_device *hdev, u8 *rdesc, 3771 - unsigned int *rsize) 3770 + static const u8 *hidpp_report_fixup(struct hid_device *hdev, u8 *rdesc, 3771 + unsigned int *rsize) 3772 3772 { 3773 3773 struct hidpp_device *hidpp = hid_get_drvdata(hdev); 3774 3774
+2 -2
drivers/hid/hid-macally.c
··· 18 18 * The Macally ikey keyboard says that its logical and usage maximums are both 19 19 * 101, but the power key is 102 and the equals key is 103 20 20 */ 21 - static __u8 *macally_report_fixup(struct hid_device *hdev, __u8 *rdesc, 22 - unsigned int *rsize) 21 + static const __u8 *macally_report_fixup(struct hid_device *hdev, __u8 *rdesc, 22 + unsigned int *rsize) 23 23 { 24 24 if (*rsize >= 60 && rdesc[53] == 0x65 && rdesc[59] == 0x65) { 25 25 hid_info(hdev,
+2 -2
drivers/hid/hid-magicmouse.c
··· 907 907 hid_hw_stop(hdev); 908 908 } 909 909 910 - static __u8 *magicmouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, 911 - unsigned int *rsize) 910 + static const __u8 *magicmouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, 911 + unsigned int *rsize) 912 912 { 913 913 /* 914 914 * Change the usage from:
+2 -2
drivers/hid/hid-maltron.c
··· 137 137 0xC0 /* End Collection */ 138 138 }; 139 139 140 - static __u8 *maltron_report_fixup(struct hid_device *hdev, __u8 *rdesc, 141 - unsigned int *rsize) 140 + static const __u8 *maltron_report_fixup(struct hid_device *hdev, __u8 *rdesc, 141 + unsigned int *rsize) 142 142 { 143 143 if (*rsize == sizeof(maltron_rdesc_o) && 144 144 !memcmp(maltron_rdesc_o, rdesc, sizeof(maltron_rdesc_o))) {
+1 -1
drivers/hid/hid-microsoft.c
··· 56 56 __u8 loop_count; 57 57 } __packed; 58 58 59 - static __u8 *ms_report_fixup(struct hid_device *hdev, __u8 *rdesc, 59 + static const __u8 *ms_report_fixup(struct hid_device *hdev, __u8 *rdesc, 60 60 unsigned int *rsize) 61 61 { 62 62 struct ms_data *ms = hid_get_drvdata(hdev);
+1 -1
drivers/hid/hid-monterey.c
··· 18 18 19 19 #include "hid-ids.h" 20 20 21 - static __u8 *mr_report_fixup(struct hid_device *hdev, __u8 *rdesc, 21 + static const __u8 *mr_report_fixup(struct hid_device *hdev, __u8 *rdesc, 22 22 unsigned int *rsize) 23 23 { 24 24 if (*rsize >= 31 && rdesc[29] == 0x05 && rdesc[30] == 0x09) {
+1 -1
drivers/hid/hid-multitouch.c
··· 1441 1441 return 0; 1442 1442 } 1443 1443 1444 - static __u8 *mt_report_fixup(struct hid_device *hdev, __u8 *rdesc, 1444 + static const __u8 *mt_report_fixup(struct hid_device *hdev, __u8 *rdesc, 1445 1445 unsigned int *size) 1446 1446 { 1447 1447 if (hdev->vendor == I2C_VENDOR_ID_GOODIX &&
+1 -1
drivers/hid/hid-nti.c
··· 29 29 /* 30 30 * NTI Sun keyboard adapter has wrong logical maximum in report descriptor 31 31 */ 32 - static __u8 *nti_usbsun_report_fixup(struct hid_device *hdev, __u8 *rdesc, 32 + static const __u8 *nti_usbsun_report_fixup(struct hid_device *hdev, __u8 *rdesc, 33 33 unsigned int *rsize) 34 34 { 35 35 if (*rsize >= 60 && rdesc[53] == 0x65 && rdesc[59] == 0x65) {
+1 -1
drivers/hid/hid-ortek.c
··· 22 22 23 23 #include "hid-ids.h" 24 24 25 - static __u8 *ortek_report_fixup(struct hid_device *hdev, __u8 *rdesc, 25 + static const __u8 *ortek_report_fixup(struct hid_device *hdev, __u8 *rdesc, 26 26 unsigned int *rsize) 27 27 { 28 28 if (*rsize >= 56 && rdesc[54] == 0x25 && rdesc[55] == 0x01) {
+1 -1
drivers/hid/hid-petalynx.c
··· 19 19 #include "hid-ids.h" 20 20 21 21 /* Petalynx Maxter Remote has maximum for consumer page set too low */ 22 - static __u8 *pl_report_fixup(struct hid_device *hdev, __u8 *rdesc, 22 + static const __u8 *pl_report_fixup(struct hid_device *hdev, __u8 *rdesc, 23 23 unsigned int *rsize) 24 24 { 25 25 if (*rsize >= 62 && rdesc[39] == 0x2a && rdesc[40] == 0xf5 &&
+1 -1
drivers/hid/hid-prodikeys.c
··· 728 728 /* 729 729 * PC-MIDI report descriptor for report id is wrong. 730 730 */ 731 - static __u8 *pk_report_fixup(struct hid_device *hdev, __u8 *rdesc, 731 + static const __u8 *pk_report_fixup(struct hid_device *hdev, __u8 *rdesc, 732 732 unsigned int *rsize) 733 733 { 734 734 if (*rsize == 178 &&
+2 -2
drivers/hid/hid-pxrc.c
··· 42 42 0xC0, // End Collection 43 43 }; 44 44 45 - static __u8 *pxrc_report_fixup(struct hid_device *hdev, __u8 *rdesc, 46 - unsigned int *rsize) 45 + static const __u8 *pxrc_report_fixup(struct hid_device *hdev, __u8 *rdesc, 46 + unsigned int *rsize) 47 47 { 48 48 hid_info(hdev, "fixing up PXRC report descriptor\n"); 49 49 *rsize = sizeof(pxrc_rdesc_fixed);
+1 -1
drivers/hid/hid-redragon.c
··· 33 33 * key codes are generated. 34 34 */ 35 35 36 - static __u8 *redragon_report_fixup(struct hid_device *hdev, __u8 *rdesc, 36 + static const __u8 *redragon_report_fixup(struct hid_device *hdev, __u8 *rdesc, 37 37 unsigned int *rsize) 38 38 { 39 39 if (*rsize >= 102 && rdesc[100] == 0x81 && rdesc[101] == 0x00) {
+1 -1
drivers/hid/hid-saitek.c
··· 66 66 return 0; 67 67 } 68 68 69 - static __u8 *saitek_report_fixup(struct hid_device *hdev, __u8 *rdesc, 69 + static const __u8 *saitek_report_fixup(struct hid_device *hdev, __u8 *rdesc, 70 70 unsigned int *rsize) 71 71 { 72 72 struct saitek_sc *ssc = hid_get_drvdata(hdev);
+1 -1
drivers/hid/hid-samsung.c
··· 469 469 return 1; 470 470 } 471 471 472 - static __u8 *samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, 472 + static const __u8 *samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, 473 473 unsigned int *rsize) 474 474 { 475 475 if (hdev->product == USB_DEVICE_ID_SAMSUNG_IR_REMOTE && hid_is_usb(hdev))
+2 -2
drivers/hid/hid-semitek.c
··· 11 11 12 12 #include "hid-ids.h" 13 13 14 - static __u8 *semitek_report_fixup(struct hid_device *hdev, __u8 *rdesc, 15 - unsigned int *rsize) 14 + static const __u8 *semitek_report_fixup(struct hid_device *hdev, __u8 *rdesc, 15 + unsigned int *rsize) 16 16 { 17 17 /* In the report descriptor for interface 2, fix the incorrect 18 18 description of report ID 0x04 (the report contains a
+1 -1
drivers/hid/hid-sensor-hub.c
··· 580 580 } 581 581 EXPORT_SYMBOL_GPL(sensor_hub_device_close); 582 582 583 - static __u8 *sensor_hub_report_fixup(struct hid_device *hdev, __u8 *rdesc, 583 + static const __u8 *sensor_hub_report_fixup(struct hid_device *hdev, __u8 *rdesc, 584 584 unsigned int *rsize) 585 585 { 586 586 /*
+2 -2
drivers/hid/hid-sigmamicro.c
··· 99 99 0xc0, /* End Collection 166 */ 100 100 }; 101 101 102 - static __u8 *sm_report_fixup(struct hid_device *hdev, __u8 *rdesc, 103 - unsigned int *rsize) 102 + static const __u8 *sm_report_fixup(struct hid_device *hdev, __u8 *rdesc, 103 + unsigned int *rsize) 104 104 { 105 105 if (*rsize == sizeof(sm_0059_rdesc) && 106 106 !memcmp(sm_0059_rdesc, rdesc, *rsize)) {
+1 -1
drivers/hid/hid-sony.c
··· 743 743 return -1; 744 744 } 745 745 746 - static u8 *sony_report_fixup(struct hid_device *hdev, u8 *rdesc, 746 + static const u8 *sony_report_fixup(struct hid_device *hdev, u8 *rdesc, 747 747 unsigned int *rsize) 748 748 { 749 749 struct sony_sc *sc = hid_get_drvdata(hdev);
+2 -2
drivers/hid/hid-steelseries.c
··· 570 570 hid_hw_stop(hdev); 571 571 } 572 572 573 - static __u8 *steelseries_srws1_report_fixup(struct hid_device *hdev, __u8 *rdesc, 574 - unsigned int *rsize) 573 + static const __u8 *steelseries_srws1_report_fixup(struct hid_device *hdev, 574 + __u8 *rdesc, unsigned int *rsize) 575 575 { 576 576 if (hdev->vendor != USB_VENDOR_ID_STEELSERIES || 577 577 hdev->product != USB_DEVICE_ID_STEELSERIES_SRWS1)
+1 -1
drivers/hid/hid-sunplus.c
··· 18 18 19 19 #include "hid-ids.h" 20 20 21 - static __u8 *sp_report_fixup(struct hid_device *hdev, __u8 *rdesc, 21 + static const __u8 *sp_report_fixup(struct hid_device *hdev, __u8 *rdesc, 22 22 unsigned int *rsize) 23 23 { 24 24 if (*rsize >= 112 && rdesc[104] == 0x26 && rdesc[105] == 0x80 &&
+2 -2
drivers/hid/hid-topre.c
··· 21 21 * events it's actually sending. It claims to send array events but is instead 22 22 * sending variable events. 23 23 */ 24 - static __u8 *topre_report_fixup(struct hid_device *hdev, __u8 *rdesc, 25 - unsigned int *rsize) 24 + static const __u8 *topre_report_fixup(struct hid_device *hdev, __u8 *rdesc, 25 + unsigned int *rsize) 26 26 { 27 27 if (*rsize >= 119 && rdesc[69] == 0x29 && rdesc[70] == 0xe7 && 28 28 rdesc[71] == 0x81 && rdesc[72] == 0x00) {
+1 -1
drivers/hid/hid-uclogic-core.c
··· 50 50 input_sync(input); 51 51 } 52 52 53 - static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc, 53 + static const __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc, 54 54 unsigned int *rsize) 55 55 { 56 56 struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
+2 -2
drivers/hid/hid-viewsonic.c
··· 70 70 0xC0 /* End Collection */ 71 71 }; 72 72 73 - static __u8 *viewsonic_report_fixup(struct hid_device *hdev, __u8 *rdesc, 74 - unsigned int *rsize) 73 + static const __u8 *viewsonic_report_fixup(struct hid_device *hdev, __u8 *rdesc, 74 + unsigned int *rsize) 75 75 { 76 76 switch (hdev->product) { 77 77 case USB_DEVICE_ID_VIEWSONIC_PD1011:
+2 -2
drivers/hid/hid-vrc2.c
··· 38 38 0xC0, // End Collection 39 39 }; 40 40 41 - static __u8 *vrc2_report_fixup(struct hid_device *hdev, __u8 *rdesc, 42 - unsigned int *rsize) 41 + static const __u8 *vrc2_report_fixup(struct hid_device *hdev, __u8 *rdesc, 42 + unsigned int *rsize) 43 43 { 44 44 hid_info(hdev, "fixing up VRC-2 report descriptor\n"); 45 45 *rsize = sizeof(vrc2_rdesc_fixed);
+1 -1
drivers/hid/hid-waltop.c
··· 599 599 0xC0 /* End Collection */ 600 600 }; 601 601 602 - static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc, 602 + static const __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc, 603 603 unsigned int *rsize) 604 604 { 605 605 switch (hdev->product) {
+1 -1
drivers/hid/hid-winwing.c
··· 165 165 * This module skips numbers 32-63, unused on some throttle grips. 166 166 */ 167 167 168 - static __u8 *winwing_report_fixup(struct hid_device *hdev, __u8 *rdesc, 168 + static const __u8 *winwing_report_fixup(struct hid_device *hdev, __u8 *rdesc, 169 169 unsigned int *rsize) 170 170 { 171 171 int sig_length = sizeof(original_rdesc_buttons);
+2 -2
drivers/hid/hid-xiaomi.c
··· 61 61 0xC0 /* End Collection */ 62 62 }; 63 63 64 - static __u8 *xiaomi_report_fixup(struct hid_device *hdev, __u8 *rdesc, 65 - unsigned int *rsize) 64 + static const __u8 *xiaomi_report_fixup(struct hid_device *hdev, __u8 *rdesc, 65 + unsigned int *rsize) 66 66 { 67 67 switch (hdev->product) { 68 68 case USB_DEVICE_ID_MI_SILENT_MOUSE:
+1 -1
drivers/hid/hid-zydacron.c
··· 24 24 * Zydacron remote control has an invalid HID report descriptor, 25 25 * that needs fixing before we can parse it. 26 26 */ 27 - static __u8 *zc_report_fixup(struct hid_device *hdev, __u8 *rdesc, 27 + static const __u8 *zc_report_fixup(struct hid_device *hdev, __u8 *rdesc, 28 28 unsigned int *rsize) 29 29 { 30 30 if (*rsize >= 253 &&
+1 -1
include/linux/hid.h
··· 822 822 struct hid_usage *usage, __s32 value); 823 823 void (*report)(struct hid_device *hdev, struct hid_report *report); 824 824 825 - __u8 *(*report_fixup)(struct hid_device *hdev, __u8 *buf, 825 + const __u8 *(*report_fixup)(struct hid_device *hdev, __u8 *buf, 826 826 unsigned int *size); 827 827 828 828 int (*input_mapping)(struct hid_device *hdev,