]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
HID: holtek-kbd: constify fixed up report descriptor
authorThomas Weißschuh <linux@weissschuh.net>
Wed, 28 Aug 2024 07:33:22 +0000 (09:33 +0200)
committerBenjamin Tissoires <bentiss@kernel.org>
Thu, 5 Sep 2024 14:20:56 +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-3-663b9210eb69@weissschuh.net
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
drivers/hid/hid-holtek-kbd.c

index 794d609c2e313a735fb5d17cb29adc367e246142..d13543517a6c96ef14faf5d546b671d1d49aa56c 100644 (file)
@@ -27,7 +27,7 @@
  * to the boot interface.
  */
 
-static __u8 holtek_kbd_rdesc_fixed[] = {
+static const __u8 holtek_kbd_rdesc_fixed[] = {
        /* Original report descriptor, with reduced number of consumer usages */
        0x05, 0x01,         /*  Usage Page (Desktop),                         */
        0x09, 0x80,         /*  Usage (Sys Control),                          */
@@ -108,8 +108,8 @@ static const __u8 *holtek_kbd_report_fixup(struct hid_device *hdev, __u8 *rdesc,
        struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
 
        if (intf->cur_altsetting->desc.bInterfaceNumber == 1) {
-               rdesc = holtek_kbd_rdesc_fixed;
                *rsize = sizeof(holtek_kbd_rdesc_fixed);
+               return holtek_kbd_rdesc_fixed;
        }
        return rdesc;
 }