All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 10/35] net: usb: catc: constify usb_device_id and fix space before '[' error
@ 2017-08-08 15:58 Arvind Yadav
  2017-08-08 15:58 ` [PATCH 11/35] net: usb: cdc-phonet: constify usb_device_id Arvind Yadav
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Arvind Yadav @ 2017-08-08 15:58 UTC (permalink / raw)
  To: kvalo; +Cc: linux-kernel, netdev, linux-usb

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/net/usb/catc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c
index fce92f0..01cd17e 100644
--- a/drivers/net/usb/catc.c
+++ b/drivers/net/usb/catc.c
@@ -961,7 +961,7 @@ static void catc_disconnect(struct usb_interface *intf)
  * Module functions and tables.
  */
 
-static struct usb_device_id catc_id_table [] = {
+static const struct usb_device_id catc_id_table[] = {
 	{ USB_DEVICE(0x0423, 0xa) },	/* CATC Netmate, Belkin F5U011 */
 	{ USB_DEVICE(0x0423, 0xc) },	/* CATC Netmate II, Belkin F5U111 */
 	{ USB_DEVICE(0x08d1, 0x1) },	/* smartBridges smartNIC */
-- 
2.7.4

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

* [PATCH 11/35] net: usb: cdc-phonet: constify usb_device_id
  2017-08-08 15:58 [PATCH 10/35] net: usb: catc: constify usb_device_id and fix space before '[' error Arvind Yadav
@ 2017-08-08 15:58 ` Arvind Yadav
  2017-08-08 15:58 ` [PATCH 12/35] net: usb: ipheth: " Arvind Yadav
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Arvind Yadav @ 2017-08-08 15:58 UTC (permalink / raw)
  To: kvalo; +Cc: linux-kernel, netdev, linux-usb

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/net/usb/cdc-phonet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c
index 2952cb5..288ecd9 100644
--- a/drivers/net/usb/cdc-phonet.c
+++ b/drivers/net/usb/cdc-phonet.c
@@ -304,7 +304,7 @@ static void usbpn_setup(struct net_device *dev)
 /*
  * USB driver callbacks
  */
-static struct usb_device_id usbpn_ids[] = {
+static const struct usb_device_id usbpn_ids[] = {
 	{
 		.match_flags = USB_DEVICE_ID_MATCH_VENDOR
 			| USB_DEVICE_ID_MATCH_INT_CLASS
-- 
2.7.4

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

* [PATCH 12/35] net: usb: ipheth: constify usb_device_id
  2017-08-08 15:58 [PATCH 10/35] net: usb: catc: constify usb_device_id and fix space before '[' error Arvind Yadav
  2017-08-08 15:58 ` [PATCH 11/35] net: usb: cdc-phonet: constify usb_device_id Arvind Yadav
@ 2017-08-08 15:58 ` Arvind Yadav
  2017-08-08 15:58 ` [PATCH 13/35] net: usb: kaweth: " Arvind Yadav
  2017-08-08 15:58 ` [PATCH 14/35] net: usb: r8152: " Arvind Yadav
  3 siblings, 0 replies; 5+ messages in thread
From: Arvind Yadav @ 2017-08-08 15:58 UTC (permalink / raw)
  To: kvalo; +Cc: linux-kernel, netdev, linux-usb

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/net/usb/ipheth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index 0f213ea..d49c710 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -87,7 +87,7 @@
 #define IPHETH_CARRIER_CHECK_TIMEOUT round_jiffies_relative(1 * HZ)
 #define IPHETH_CARRIER_ON       0x04
 
-static struct usb_device_id ipheth_table[] = {
+static const struct usb_device_id ipheth_table[] = {
 	{ USB_DEVICE_AND_INTERFACE_INFO(
 		USB_VENDOR_APPLE, USB_PRODUCT_IPHONE,
 		IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
-- 
2.7.4

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

* [PATCH 13/35] net: usb: kaweth: constify usb_device_id
  2017-08-08 15:58 [PATCH 10/35] net: usb: catc: constify usb_device_id and fix space before '[' error Arvind Yadav
  2017-08-08 15:58 ` [PATCH 11/35] net: usb: cdc-phonet: constify usb_device_id Arvind Yadav
  2017-08-08 15:58 ` [PATCH 12/35] net: usb: ipheth: " Arvind Yadav
@ 2017-08-08 15:58 ` Arvind Yadav
  2017-08-08 15:58 ` [PATCH 14/35] net: usb: r8152: " Arvind Yadav
  3 siblings, 0 replies; 5+ messages in thread
From: Arvind Yadav @ 2017-08-08 15:58 UTC (permalink / raw)
  To: kvalo; +Cc: linux-kernel, netdev, linux-usb

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/net/usb/kaweth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index 92e4fd2..f160583 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -125,7 +125,7 @@ static int kaweth_resume(struct usb_interface *intf);
 /****************************************************************
  *     usb_device_id
  ****************************************************************/
-static struct usb_device_id usb_klsi_table[] = {
+static const struct usb_device_id usb_klsi_table[] = {
 	{ USB_DEVICE(0x03e8, 0x0008) }, /* AOX Endpoints USB Ethernet */
 	{ USB_DEVICE(0x04bb, 0x0901) }, /* I-O DATA USB-ET/T */
 	{ USB_DEVICE(0x0506, 0x03e8) }, /* 3Com 3C19250 */
-- 
2.7.4

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

* [PATCH 14/35] net: usb: r8152: constify usb_device_id
  2017-08-08 15:58 [PATCH 10/35] net: usb: catc: constify usb_device_id and fix space before '[' error Arvind Yadav
                   ` (2 preceding siblings ...)
  2017-08-08 15:58 ` [PATCH 13/35] net: usb: kaweth: " Arvind Yadav
@ 2017-08-08 15:58 ` Arvind Yadav
  3 siblings, 0 replies; 5+ messages in thread
From: Arvind Yadav @ 2017-08-08 15:58 UTC (permalink / raw)
  To: kvalo; +Cc: linux-kernel, netdev, linux-usb

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/net/usb/r8152.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 6cfffef..ceb78e2 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -5303,7 +5303,7 @@ static void rtl8152_disconnect(struct usb_interface *intf)
 	.bInterfaceProtocol = USB_CDC_PROTO_NONE
 
 /* table of devices that work with this driver */
-static struct usb_device_id rtl8152_table[] = {
+static const struct usb_device_id rtl8152_table[] = {
 	{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8050)},
 	{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152)},
 	{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)},
-- 
2.7.4

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-08 15:58 [PATCH 10/35] net: usb: catc: constify usb_device_id and fix space before '[' error Arvind Yadav
2017-08-08 15:58 ` [PATCH 11/35] net: usb: cdc-phonet: constify usb_device_id Arvind Yadav
2017-08-08 15:58 ` [PATCH 12/35] net: usb: ipheth: " Arvind Yadav
2017-08-08 15:58 ` [PATCH 13/35] net: usb: kaweth: " Arvind Yadav
2017-08-08 15:58 ` [PATCH 14/35] net: usb: r8152: " Arvind Yadav

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.