diff mbox series

[v2,2/7] HID: constify parameter rdesc of hid_parse_report()

Message ID 20240803-hid-const-fixup-v2-2-f53d7a7b29d8@weissschuh.net
State Accepted
Commit 6737769ca0b6bfc82df53db5fd69068902d608db
Headers show
Series HID: constify report descriptors | expand

Commit Message

Thomas Weißschuh Aug. 3, 2024, 12:34 p.m. UTC
The parameter is never modified, so mark it as const.

This is a prerequisite for constification changes in the HID core.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/hid/hid-core.c | 2 +-
 include/linux/hid.h    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 988d0acbdf04..0d2cbe491708 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -946,7 +946,7 @@  static int hid_scan_report(struct hid_device *hid)
  * Allocate the device report as read by the bus driver. This function should
  * only be called from parse() in ll drivers.
  */
-int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size)
+int hid_parse_report(struct hid_device *hid, const __u8 *start, unsigned size)
 {
 	hid->dev_rdesc = kmemdup(start, size, GFP_KERNEL);
 	if (!hid->dev_rdesc)
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 1533c9dcd3a6..e7a5d6f2f2eb 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -953,7 +953,7 @@  struct hid_device *hid_allocate_device(void);
 struct hid_report *hid_register_report(struct hid_device *device,
 				       enum hid_report_type type, unsigned int id,
 				       unsigned int application);
-int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
+int hid_parse_report(struct hid_device *hid, const __u8 *start, unsigned size);
 struct hid_report *hid_validate_values(struct hid_device *hid,
 				       enum hid_report_type type, unsigned int id,
 				       unsigned int field_index,