From: Thomas Weißschuh Date: Sat, 3 Aug 2024 12:34:19 +0000 (+0200) Subject: HID: constify hid_device::rdesc X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=24ddd0d7de7aaf50f537fd727f31616cb5a65a9e;p=linux.git HID: constify hid_device::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-3-f53d7a7b29d8@weissschuh.net Signed-off-by: Benjamin Tissoires --- diff --git a/include/linux/hid.h b/include/linux/hid.h index e7a5d6f2f2eb..dda34d8cad19 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -602,7 +602,7 @@ struct hid_ll_driver; struct hid_device { /* device report descriptor */ __u8 *dev_rdesc; unsigned dev_rsize; - __u8 *rdesc; + const __u8 *rdesc; unsigned rsize; struct hid_collection *collection; /* List of HID collections */ unsigned collection_size; /* Number of allocated hid_collections */