Linux Input Archive on lore.kernel.org
 help / color / 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
  2020-07-27 13:22 ` [PATCH 2/2] HID: macally: Constify macally_id_table Rikard Falkeborn
  0 siblings, 2 replies; 3+ 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] 3+ 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
  1 sibling, 0 replies; 3+ 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	[flat|nested] 3+ 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
  1 sibling, 0 replies; 3+ 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	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ 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

Linux Input Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-input/0 linux-input/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-input linux-input/ https://lore.kernel.org/linux-input \
		linux-input@vger.kernel.org
	public-inbox-index linux-input

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-input


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git