]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
HID: viewsonic: constify fixed up report descriptor
authorThomas Weißschuh <linux@weissschuh.net>
Wed, 28 Aug 2024 07:33:27 +0000 (09:33 +0200)
committerBenjamin Tissoires <bentiss@kernel.org>
Thu, 5 Sep 2024 14:20:57 +0000 (16:20 +0200)
Now that the HID core can handle const report descriptors,
constify them where possible.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://patch.msgid.link/20240828-hid-const-fixup-2-v1-8-663b9210eb69@weissschuh.net
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
drivers/hid/hid-viewsonic.c

index 86f41e3fcb95dd29a738467c87432aaa0e944da3..532bed88bdf8a28479c083aa9a3e8b4aee81b1a2 100644 (file)
@@ -22,7 +22,7 @@
 #define PD1011_RDESC_ORIG_SIZE 408
 
 /* Fixed report descriptor of PD1011 signature pad */
-static __u8 pd1011_rdesc_fixed[] = {
+static const __u8 pd1011_rdesc_fixed[] = {
        0x05, 0x0D,             /*  Usage Page (Digitizer),             */
        0x09, 0x01,             /*  Usage (Digitizer),                  */
        0xA1, 0x01,             /*  Collection (Application),           */
@@ -77,8 +77,8 @@ static const __u8 *viewsonic_report_fixup(struct hid_device *hdev, __u8 *rdesc,
        case USB_DEVICE_ID_VIEWSONIC_PD1011:
        case USB_DEVICE_ID_SIGNOTEC_VIEWSONIC_PD1011:
                if (*rsize == PD1011_RDESC_ORIG_SIZE) {
-                       rdesc = pd1011_rdesc_fixed;
                        *rsize = sizeof(pd1011_rdesc_fixed);
+                       return pd1011_rdesc_fixed;
                }
                break;
        }