diff options
author | Thomas Weißschuh <linux@weissschuh.net> | 2024-08-03 14:34:22 +0200 |
---|---|---|
committer | Benjamin Tissoires <bentiss@kernel.org> | 2024-08-27 16:29:55 +0200 |
commit | fe73965d078670406acee0218f118c0870d6a58b (patch) | |
tree | b343efa1c3955abb57b534b7c320780fac3c9c8c /drivers/hid/hid-steelseries.c | |
parent | 3593630c89d7d3963c42262694f8aa8b4727a0ad (diff) | |
download | linux-fe73965d078670406acee0218f118c0870d6a58b.tar.gz linux-fe73965d078670406acee0218f118c0870d6a58b.tar.bz2 linux-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 <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 'drivers/hid/hid-steelseries.c')
-rw-r--r-- | drivers/hid/hid-steelseries.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hid/hid-steelseries.c b/drivers/hid/hid-steelseries.c index 2154e14f55f1..895da49e8ead 100644 --- a/drivers/hid/hid-steelseries.c +++ b/drivers/hid/hid-steelseries.c @@ -570,8 +570,8 @@ static void steelseries_remove(struct hid_device *hdev) hid_hw_stop(hdev); } -static __u8 *steelseries_srws1_report_fixup(struct hid_device *hdev, __u8 *rdesc, - unsigned int *rsize) +static const __u8 *steelseries_srws1_report_fixup(struct hid_device *hdev, + __u8 *rdesc, unsigned int *rsize) { if (hdev->vendor != USB_VENDOR_ID_STEELSERIES || hdev->product != USB_DEVICE_ID_STEELSERIES_SRWS1) |