summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2024-08-03 15:34:22 +0300
committerBenjamin Tissoires <bentiss@kernel.org>2024-08-27 17:29:55 +0300
commitfe73965d078670406acee0218f118c0870d6a58b (patch)
treeb343efa1c3955abb57b534b7c320780fac3c9c8c /include
parent3593630c89d7d3963c42262694f8aa8b4727a0ad (diff)
downloadlinux-fe73965d078670406acee0218f118c0870d6a58b.tar.xz
HID: change return type of report_fixup() to const
By allowing the drivers to return a "const *" they can constify their static report arrays. This makes it clear to driver authors that the HID core will not modify those reports and they can be reused for multiple devices. Furthermore security is slightly improved as those reports are protected against accidental or malicious modifications. [bentiss: fixup hid-cougar.c and hid-multitouch.c for latest version of the master branch] Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://patch.msgid.link/20240803-hid-const-fixup-v2-6-f53d7a7b29d8@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/hid.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h
index c5fb43db0f2e..3a998fa3812d 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -822,7 +822,7 @@ struct hid_driver {
struct hid_usage *usage, __s32 value);
void (*report)(struct hid_device *hdev, struct hid_report *report);
- __u8 *(*report_fixup)(struct hid_device *hdev, __u8 *buf,
+ const __u8 *(*report_fixup)(struct hid_device *hdev, __u8 *buf,
unsigned int *size);
int (*input_mapping)(struct hid_device *hdev,