From: Thomas Weißschuh Date: Sat, 3 Aug 2024 12:34:21 +0000 (+0200) Subject: HID: constify hid_device::dev_rdesc X-Git-Tag: v6.12-rc1~128^2~10^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3593630c89d7d3963c42262694f8aa8b4727a0ad;p=thirdparty%2Flinux.git HID: constify hid_device::dev_rdesc 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 Link: https://patch.msgid.link/20240803-hid-const-fixup-v2-5-f53d7a7b29d8@weissschuh.net Signed-off-by: Benjamin Tissoires --- diff --git a/include/linux/hid.h b/include/linux/hid.h index 502bbc6f078c8..c5fb43db0f2e6 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -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;