linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] HID: Constify static struct hid_device_id
@ 2020-07-27 13:21 Rikard Falkeborn
  2020-07-27 13:21 ` [PATCH 1/2] HID: cougar: Constify cougar_id_table Rikard Falkeborn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rikard Falkeborn @ 2020-07-27 13:21 UTC (permalink / raw)
  To: jikos, benjamin.tissoires
  Cc: linux-input, linux-kernel, dmlambea, alexhenrie24, Rikard Falkeborn

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(-)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] HID: cougar: Constify cougar_id_table
  2020-07-27 13:21 [PATCH 0/2] HID: Constify static struct hid_device_id Rikard Falkeborn
@ 2020-07-27 13:21 ` Rikard Falkeborn
  2020-07-27 13:22 ` [PATCH 2/2] HID: macally: Constify macally_id_table Rikard Falkeborn
  2020-08-17  9:52 ` [PATCH 0/2] HID: Constify static struct hid_device_id Jiri Kosina
  2 siblings, 0 replies; 4+ messages in thread
From: Rikard Falkeborn @ 2020-07-27 13:21 UTC (permalink / raw)
  To: jikos, benjamin.tissoires
  Cc: linux-input, linux-kernel, dmlambea, alexhenrie24, Rikard Falkeborn

cougar_id_table[] is not changed and can be made const to allow the
compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/hid/hid-cougar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-cougar.c b/drivers/hid/hid-cougar.c
index 4ff3bc1d25e2..28d671c5e0ca 100644
--- a/drivers/hid/hid-cougar.c
+++ b/drivers/hid/hid-cougar.c
@@ -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,
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] HID: macally: Constify macally_id_table
  2020-07-27 13:21 [PATCH 0/2] HID: Constify static struct hid_device_id Rikard Falkeborn
  2020-07-27 13:21 ` [PATCH 1/2] HID: cougar: Constify cougar_id_table Rikard Falkeborn
@ 2020-07-27 13:22 ` Rikard Falkeborn
  2020-08-17  9:52 ` [PATCH 0/2] HID: Constify static struct hid_device_id Jiri Kosina
  2 siblings, 0 replies; 4+ messages in thread
From: Rikard Falkeborn @ 2020-07-27 13:22 UTC (permalink / raw)
  To: jikos, benjamin.tissoires
  Cc: linux-input, linux-kernel, dmlambea, alexhenrie24, Rikard Falkeborn

macally_id_table is not modified and can be made const to allow the
compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/hid/hid-macally.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-macally.c b/drivers/hid/hid-macally.c
index 9a4fc7dffb14..aea46e522008 100644
--- a/drivers/hid/hid-macally.c
+++ b/drivers/hid/hid-macally.c
@@ -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) },
 	{ }
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] HID: Constify static struct hid_device_id
  2020-07-27 13:21 [PATCH 0/2] HID: Constify static struct hid_device_id Rikard Falkeborn
  2020-07-27 13:21 ` [PATCH 1/2] HID: cougar: Constify cougar_id_table Rikard Falkeborn
  2020-07-27 13:22 ` [PATCH 2/2] HID: macally: Constify macally_id_table Rikard Falkeborn
@ 2020-08-17  9:52 ` Jiri Kosina
  2 siblings, 0 replies; 4+ messages in thread
From: Jiri Kosina @ 2020-08-17  9:52 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: benjamin.tissoires, linux-input, linux-kernel, dmlambea, alexhenrie24

On Mon, 27 Jul 2020, Rikard Falkeborn wrote:

> 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(-)

Applied both patches, thanks.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-17  9:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 13:21 [PATCH 0/2] HID: Constify static struct hid_device_id Rikard Falkeborn
2020-07-27 13:21 ` [PATCH 1/2] HID: cougar: Constify cougar_id_table Rikard Falkeborn
2020-07-27 13:22 ` [PATCH 2/2] HID: macally: Constify macally_id_table Rikard Falkeborn
2020-08-17  9:52 ` [PATCH 0/2] HID: Constify static struct hid_device_id Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).