]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
HID: constify hid_device::dev_rdesc
authorThomas Weißschuh <linux@weissschuh.net>
Sat, 3 Aug 2024 12:34:21 +0000 (14:34 +0200)
committerBenjamin Tissoires <bentiss@kernel.org>
Tue, 27 Aug 2024 14:18:51 +0000 (16:18 +0200)
Once a report descriptor has been created by the HID core it is not
supposed to be modified anymore.
Enforce this invariant through the type system.

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

index 502bbc6f078c8d0f8b175ec0c84d555b863ace62..c5fb43db0f2e6440f1f192062ade0a56f1150427 100644 (file)
@@ -600,7 +600,7 @@ struct hid_driver;
 struct hid_ll_driver;
 
 struct hid_device {                                                    /* device report descriptor */
-       __u8 *dev_rdesc;
+       const __u8 *dev_rdesc;
        unsigned dev_rsize;
        const __u8 *rdesc;
        unsigned rsize;