linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] constify input usb_device_id.
@ 2017-08-06  7:41 Arvind Yadav
  2017-08-06  7:41 ` [PATCH 1/8] Input: iforce: constify usb_device_id and fix space before '[' error: Arvind Yadav
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-06  7:41 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, linux-kernel

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Fix checkpatch.pl error in patch 1,3 and 7:
ERROR: space prohibited before open square bracket '['.

Arvind Yadav (8):
  [PATCH 1/8] Input: iforce: constify usb_device_id and fix space before '[' error.
  [PATCH 2/8] Input: xpad: constify usb_device_id.
  [PATCH 3/8] Input: keyspan_remote: constify usb_device_id.
  [PATCH 4/8] Input: powermate: constify usb_device_id and fix space before '[' error.
  [PATCH 5/8] Input: appletouch: constify usb_device_id.
  [PATCH 6/8] Input: synaptics_usb: constify usb_device_id.
  [PATCH 7/8] Input: acecad: constify usb_device_id and fix space before '[' error.
  [PATCH 8/8] Input: kbtab: constify usb_device_id.

 drivers/input/joystick/iforce/iforce-usb.c | 2 +-
 drivers/input/joystick/xpad.c              | 2 +-
 drivers/input/misc/keyspan_remote.c        | 2 +-
 drivers/input/misc/powermate.c             | 2 +-
 drivers/input/mouse/appletouch.c           | 2 +-
 drivers/input/mouse/synaptics_usb.c        | 2 +-
 drivers/input/tablet/acecad.c              | 2 +-
 drivers/input/tablet/kbtab.c               | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

-- 
2.7.4


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

* [PATCH 1/8] Input: iforce: constify usb_device_id and fix space before '[' error:
  2017-08-06  7:41 [PATCH 0/8] constify input usb_device_id Arvind Yadav
@ 2017-08-06  7:41 ` Arvind Yadav
  2017-08-06  7:41 ` [PATCH 2/8] Input: xpad: constify usb_device_id Arvind Yadav
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-06  7:41 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, linux-kernel

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Fix checkpatch.pl error:
ERROR: space prohibited before open square bracket '['.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/input/joystick/iforce/iforce-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c
index db64adf..db5cc35 100644
--- a/drivers/input/joystick/iforce/iforce-usb.c
+++ b/drivers/input/joystick/iforce/iforce-usb.c
@@ -209,7 +209,7 @@ static void iforce_usb_disconnect(struct usb_interface *intf)
 	kfree(iforce);
 }
 
-static struct usb_device_id iforce_usb_ids [] = {
+static const struct usb_device_id iforce_usb_ids[] = {
 	{ USB_DEVICE(0x044f, 0xa01c) },		/* Thrustmaster Motor Sport GT */
 	{ USB_DEVICE(0x046d, 0xc281) },		/* Logitech WingMan Force */
 	{ USB_DEVICE(0x046d, 0xc291) },		/* Logitech WingMan Formula Force */
-- 
2.7.4

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

* [PATCH 2/8] Input: xpad: constify usb_device_id.
  2017-08-06  7:41 [PATCH 0/8] constify input usb_device_id Arvind Yadav
  2017-08-06  7:41 ` [PATCH 1/8] Input: iforce: constify usb_device_id and fix space before '[' error: Arvind Yadav
@ 2017-08-06  7:41 ` Arvind Yadav
  2017-08-06  7:41 ` [PATCH 3/8] Input: keyspan_remote: " Arvind Yadav
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-06  7:41 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, linux-kernel

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/input/joystick/xpad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 298a6ba..2578a76 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -408,7 +408,7 @@ static const signed short xpad_abs_triggers[] = {
 #define XPAD_XBOXONE_VENDOR(vend) \
 	{ XPAD_XBOXONE_VENDOR_PROTOCOL(vend, 208) }
 
-static struct usb_device_id xpad_table[] = {
+static const struct usb_device_id xpad_table[] = {
 	{ USB_INTERFACE_INFO('X', 'B', 0) },	/* X-Box USB-IF not approved class */
 	XPAD_XBOX360_VENDOR(0x044f),		/* Thrustmaster X-Box 360 controllers */
 	XPAD_XBOX360_VENDOR(0x045e),		/* Microsoft X-Box 360 controllers */
-- 
2.7.4


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

* [PATCH 3/8] Input: keyspan_remote: constify usb_device_id.
  2017-08-06  7:41 [PATCH 0/8] constify input usb_device_id Arvind Yadav
  2017-08-06  7:41 ` [PATCH 1/8] Input: iforce: constify usb_device_id and fix space before '[' error: Arvind Yadav
  2017-08-06  7:41 ` [PATCH 2/8] Input: xpad: constify usb_device_id Arvind Yadav
@ 2017-08-06  7:41 ` Arvind Yadav
  2017-08-06  7:41 ` [PATCH 4/8] Input: powermate: constify usb_device_id and fix space before '[' error Arvind Yadav
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-06  7:41 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, linux-kernel

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/input/misc/keyspan_remote.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c
index a3fe4a9..77c47d6 100644
--- a/drivers/input/misc/keyspan_remote.c
+++ b/drivers/input/misc/keyspan_remote.c
@@ -85,7 +85,7 @@ static const unsigned short keyspan_key_table[] = {
 };
 
 /* table of devices that work with this driver */
-static struct usb_device_id keyspan_table[] = {
+static const struct usb_device_id keyspan_table[] = {
 	{ USB_DEVICE(USB_KEYSPAN_VENDOR_ID, USB_KEYSPAN_PRODUCT_UIA11) },
 	{ }					/* Terminating entry */
 };
-- 
2.7.4

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

* [PATCH 4/8] Input: powermate: constify usb_device_id and fix space before '[' error.
  2017-08-06  7:41 [PATCH 0/8] constify input usb_device_id Arvind Yadav
                   ` (2 preceding siblings ...)
  2017-08-06  7:41 ` [PATCH 3/8] Input: keyspan_remote: " Arvind Yadav
@ 2017-08-06  7:41 ` Arvind Yadav
  2017-08-06  7:41 ` [PATCH 5/8] Input: appletouch: constify usb_device_id Arvind Yadav
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-06  7:41 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, linux-kernel

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Fix checkpatch.pl error:
ERROR: space prohibited before open square bracket '['.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/input/misc/powermate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c
index 84909a1..056091b 100644
--- a/drivers/input/misc/powermate.c
+++ b/drivers/input/misc/powermate.c
@@ -432,7 +432,7 @@ static void powermate_disconnect(struct usb_interface *intf)
 	}
 }
 
-static struct usb_device_id powermate_devices [] = {
+static const struct usb_device_id powermate_devices[] = {
 	{ USB_DEVICE(POWERMATE_VENDOR, POWERMATE_PRODUCT_NEW) },
 	{ USB_DEVICE(POWERMATE_VENDOR, POWERMATE_PRODUCT_OLD) },
 	{ USB_DEVICE(CONTOUR_VENDOR, CONTOUR_JOG) },
-- 
2.7.4

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

* [PATCH 5/8] Input: appletouch: constify usb_device_id.
  2017-08-06  7:41 [PATCH 0/8] constify input usb_device_id Arvind Yadav
                   ` (3 preceding siblings ...)
  2017-08-06  7:41 ` [PATCH 4/8] Input: powermate: constify usb_device_id and fix space before '[' error Arvind Yadav
@ 2017-08-06  7:41 ` Arvind Yadav
  2017-08-06  7:41 ` [PATCH 6/8] Input: synaptics_usb: " Arvind Yadav
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-06  7:41 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, linux-kernel

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/input/mouse/appletouch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
index ef234c9..81a695d 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -125,7 +125,7 @@ static const struct atp_info geyser4_info = {
  *  According to Info.plist Geyser IV is the same as Geyser III.)
  */
 
-static struct usb_device_id atp_table[] = {
+static const struct usb_device_id atp_table[] = {
 	/* PowerBooks Feb 2005, iBooks G4 */
 	ATP_DEVICE(0x020e, fountain_info),	/* FOUNTAIN ANSI */
 	ATP_DEVICE(0x020f, fountain_info),	/* FOUNTAIN ISO */
-- 
2.7.4


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

* [PATCH 6/8] Input: synaptics_usb: constify usb_device_id.
  2017-08-06  7:41 [PATCH 0/8] constify input usb_device_id Arvind Yadav
                   ` (4 preceding siblings ...)
  2017-08-06  7:41 ` [PATCH 5/8] Input: appletouch: constify usb_device_id Arvind Yadav
@ 2017-08-06  7:41 ` Arvind Yadav
  2017-08-06  7:41 ` [PATCH 7/8] Input: acecad: constify usb_device_idi and fix space before '[' error Arvind Yadav
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-06  7:41 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, linux-kernel

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/input/mouse/synaptics_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/mouse/synaptics_usb.c b/drivers/input/mouse/synaptics_usb.c
index 6bcc018..cb7d15d 100644
--- a/drivers/input/mouse/synaptics_usb.c
+++ b/drivers/input/mouse/synaptics_usb.c
@@ -525,7 +525,7 @@ static int synusb_reset_resume(struct usb_interface *intf)
 	return synusb_resume(intf);
 }
 
-static struct usb_device_id synusb_idtable[] = {
+static const struct usb_device_id synusb_idtable[] = {
 	{ USB_DEVICE_SYNAPTICS(TP, SYNUSB_TOUCHPAD) },
 	{ USB_DEVICE_SYNAPTICS(INT_TP, SYNUSB_TOUCHPAD) },
 	{ USB_DEVICE_SYNAPTICS(CPAD,
-- 
2.7.4

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

* [PATCH 7/8] Input: acecad: constify usb_device_idi and fix space before '[' error.
  2017-08-06  7:41 [PATCH 0/8] constify input usb_device_id Arvind Yadav
                   ` (5 preceding siblings ...)
  2017-08-06  7:41 ` [PATCH 6/8] Input: synaptics_usb: " Arvind Yadav
@ 2017-08-06  7:41 ` Arvind Yadav
  2017-08-06  7:41 ` [PATCH 8/8] Input: kbtab: constify usb_device_id Arvind Yadav
  2017-08-08  3:05 ` [PATCH 0/8] constify input usb_device_id Dmitry Torokhov
  8 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-06  7:41 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, linux-kernel

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Fix checkpatch.pl error:
ERROR: space prohibited before open square bracket '['.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/input/tablet/acecad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c
index e86e377..77f41a5 100644
--- a/drivers/input/tablet/acecad.c
+++ b/drivers/input/tablet/acecad.c
@@ -260,7 +260,7 @@ static void usb_acecad_disconnect(struct usb_interface *intf)
 	kfree(acecad);
 }
 
-static struct usb_device_id usb_acecad_id_table [] = {
+static const struct usb_device_id usb_acecad_id_table[] = {
 	{ USB_DEVICE(USB_VENDOR_ID_ACECAD, USB_DEVICE_ID_FLAIR), .driver_info = 0 },
 	{ USB_DEVICE(USB_VENDOR_ID_ACECAD, USB_DEVICE_ID_302),	 .driver_info = 1 },
 	{ }
-- 
2.7.4

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

* [PATCH 8/8] Input: kbtab: constify usb_device_id.
  2017-08-06  7:41 [PATCH 0/8] constify input usb_device_id Arvind Yadav
                   ` (6 preceding siblings ...)
  2017-08-06  7:41 ` [PATCH 7/8] Input: acecad: constify usb_device_idi and fix space before '[' error Arvind Yadav
@ 2017-08-06  7:41 ` Arvind Yadav
  2017-08-08  3:05 ` [PATCH 0/8] constify input usb_device_id Dmitry Torokhov
  8 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-06  7:41 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, linux-kernel

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/input/tablet/kbtab.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c
index 4d9d649..a41c3ff 100644
--- a/drivers/input/tablet/kbtab.c
+++ b/drivers/input/tablet/kbtab.c
@@ -88,7 +88,7 @@ static void kbtab_irq(struct urb *urb)
 			__func__, retval);
 }
 
-static struct usb_device_id kbtab_ids[] = {
+static const struct usb_device_id kbtab_ids[] = {
 	{ USB_DEVICE(USB_VENDOR_ID_KBGEAR, 0x1001), .driver_info = 0 },
 	{ }
 };
-- 
2.7.4

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

* Re: [PATCH 0/8] constify input usb_device_id.
  2017-08-06  7:41 [PATCH 0/8] constify input usb_device_id Arvind Yadav
                   ` (7 preceding siblings ...)
  2017-08-06  7:41 ` [PATCH 8/8] Input: kbtab: constify usb_device_id Arvind Yadav
@ 2017-08-08  3:05 ` Dmitry Torokhov
  8 siblings, 0 replies; 10+ messages in thread
From: Dmitry Torokhov @ 2017-08-08  3:05 UTC (permalink / raw)
  To: Arvind Yadav; +Cc: linux-input, linux-kernel

On Sun, Aug 06, 2017 at 01:11:19PM +0530, Arvind Yadav wrote:
> usb_device_id are not supposed to change at runtime. All functions
> working with usb_device_id provided by <linux/usb.h> work with
> const usb_device_id. So mark the non-const structs as const.
> 
> Fix checkpatch.pl error in patch 1,3 and 7:
> ERROR: space prohibited before open square bracket '['.
> 
> Arvind Yadav (8):
>   [PATCH 1/8] Input: iforce: constify usb_device_id and fix space before '[' error.
>   [PATCH 2/8] Input: xpad: constify usb_device_id.
>   [PATCH 3/8] Input: keyspan_remote: constify usb_device_id.
>   [PATCH 4/8] Input: powermate: constify usb_device_id and fix space before '[' error.
>   [PATCH 5/8] Input: appletouch: constify usb_device_id.
>   [PATCH 6/8] Input: synaptics_usb: constify usb_device_id.
>   [PATCH 7/8] Input: acecad: constify usb_device_id and fix space before '[' error.
>   [PATCH 8/8] Input: kbtab: constify usb_device_id.
> 
>  drivers/input/joystick/iforce/iforce-usb.c | 2 +-
>  drivers/input/joystick/xpad.c              | 2 +-
>  drivers/input/misc/keyspan_remote.c        | 2 +-
>  drivers/input/misc/powermate.c             | 2 +-
>  drivers/input/mouse/appletouch.c           | 2 +-
>  drivers/input/mouse/synaptics_usb.c        | 2 +-
>  drivers/input/tablet/acecad.c              | 2 +-
>  drivers/input/tablet/kbtab.c               | 2 +-
>  8 files changed, 8 insertions(+), 8 deletions(-)

Applied the lot, thank you.

-- 
Dmitry

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

end of thread, other threads:[~2017-08-08  3:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-06  7:41 [PATCH 0/8] constify input usb_device_id Arvind Yadav
2017-08-06  7:41 ` [PATCH 1/8] Input: iforce: constify usb_device_id and fix space before '[' error: Arvind Yadav
2017-08-06  7:41 ` [PATCH 2/8] Input: xpad: constify usb_device_id Arvind Yadav
2017-08-06  7:41 ` [PATCH 3/8] Input: keyspan_remote: " Arvind Yadav
2017-08-06  7:41 ` [PATCH 4/8] Input: powermate: constify usb_device_id and fix space before '[' error Arvind Yadav
2017-08-06  7:41 ` [PATCH 5/8] Input: appletouch: constify usb_device_id Arvind Yadav
2017-08-06  7:41 ` [PATCH 6/8] Input: synaptics_usb: " Arvind Yadav
2017-08-06  7:41 ` [PATCH 7/8] Input: acecad: constify usb_device_idi and fix space before '[' error Arvind Yadav
2017-08-06  7:41 ` [PATCH 8/8] Input: kbtab: constify usb_device_id Arvind Yadav
2017-08-08  3:05 ` [PATCH 0/8] constify input usb_device_id Dmitry Torokhov

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