aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-sensor-hub.c
diff options
context:
space:
mode:
authorThomas Weißschuh <[email protected]>2024-08-03 12:34:22 +0000
committerBenjamin Tissoires <[email protected]>2024-08-27 14:29:55 +0000
commitfe73965d078670406acee0218f118c0870d6a58b (patch)
treeb343efa1c3955abb57b534b7c320780fac3c9c8c /drivers/hid/hid-sensor-hub.c
parentHID: constify hid_device::dev_rdesc (diff)
downloadkernel-fe73965d078670406acee0218f118c0870d6a58b.tar.gz
kernel-fe73965d078670406acee0218f118c0870d6a58b.zip
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
Diffstat (limited to 'drivers/hid/hid-sensor-hub.c')
-rw-r--r--drivers/hid/hid-sensor-hub.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index 26e93a331a51..7bd86eef6ec7 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -580,7 +580,7 @@ void sensor_hub_device_close(struct hid_sensor_hub_device *hsdev)
}
EXPORT_SYMBOL_GPL(sensor_hub_device_close);
-static __u8 *sensor_hub_report_fixup(struct hid_device *hdev, __u8 *rdesc,
+static const __u8 *sensor_hub_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
/*