HID: Constify static struct hid_device_id
cover HID: Constify static struct hid_device_id
Constify hid_device_id in two drivers (these were the only drivers that didn't already have it as const).
Rikard Falkeborn (2):
HID: cougar: Constify cougar_id_table
HID: macally: Constify macally_id_table
drivers/hid/hid-cougar.c | 2 +- drivers/hid/hid-macally.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.27.0
PATCH 1/2 HID: cougar: Constify cougar_id_table
cougar_id_table[] is not changed and can be made const to allow the compiler to put it in read-only memory.
--- drivers/hid/hid-cougar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-cougar.c +1 -1
@@ -321,7 +321,7 @@ static const struct kernel_param_ops cougar_g6_is_space_ops = { };module_param_cb (g6_is_space, &cougar_g6_is_space_ops, &g6_is_space,0644 ); -static struct hid_device_id cougar_id_table[] = { +static const struct hid_device_id cougar_id_table[] = { {HID_USB_DEVICE (USB_VENDOR_ID_SOLID_YEAR ,USB_DEVICE_ID_COUGAR_500K_GAMING_KEYBOARD ) }, { HID_USB_DEVICE(USB_VENDOR_ID_SOLID_YEAR,
Signature · 1 line
2.27.0
PATCH 2/2 HID: macally: Constify macally_id_table
In reply to Rikard Falkebornmacally_id_table is not modified and can be made const to allow the compiler to put it in read-only memory.
--- drivers/hid/hid-macally.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-macally.c +1 -1
@@ -29,7 +29,7 @@ static __u8 *macally_report_fixup(struct hid_device *hdev, __u8 *rdesc,return rdesc; } -static struct hid_device_id macally_id_table[] = { +static const struct hid_device_id macally_id_table[] = { {HID_USB_DEVICE (USB_VENDOR_ID_SOLID_YEAR ,USB_DEVICE_ID_MACALLY_IKEY_KEYBOARD ) }, { }
Signature · 1 line
2.27.0
Quoted 10 lines · Rikard Falkeborn
Constify
hid_device_idin two drivers (these were the only drivers that didn't already have it as const).Rikard Falkeborn (2):
HID: cougar: Constifycougar_id_table
HID: macally: Constifymacally_id_tabledrivers/hid/hid-cougar.c | 2 +- drivers/hid/hid-macally.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Applied both patches, thanks.
Signature · 2 lines
Jiri Kosina SUSE Labs