Skip to contentSkip to conversation

atm: make atmdev_ops const

PATCH Applied Bhumika Goyal 2 participants 2 messages Aug 9, 2017 – Aug 10, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 atm: make atmdev_ops const

Make these structures const as they are either passed to the function atm_dev_register having the corresponding argument as const or stored in the ops field of a atm_dev structure, which is also const. Done using Coccinelle.

---
 drivers/atm/adummy.c    | 2 +-
 drivers/atm/atmtcp.c    | 2 +-
 drivers/atm/he.c        | 2 +-
 drivers/atm/idt77252.c  | 2 +-
 drivers/atm/nicstar.c   | 2 +-
 drivers/atm/solos-pci.c | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
drivers/atm/adummy.c +1 -1
index da27ddf..8d98130 100644
@@ -130,7 +130,7 @@ static ssize_t __show_signal(struct device *dev,
 	return 0;
 }
 
-static struct atmdev_ops adummy_ops =
+static const struct atmdev_ops adummy_ops =
 {
 	.open =		adummy_open,
 	.close =	adummy_close,	
drivers/atm/atmtcp.c +1 -1
index 56fa16c..afebeb1 100644
@@ -342,7 +342,7 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
  */
 
 
-static struct atmdev_ops atmtcp_c_dev_ops = {
+static const struct atmdev_ops atmtcp_c_dev_ops = {
 	.close		= atmtcp_c_close,
 	.send		= atmtcp_c_send
 };
drivers/atm/he.c +1 -1
index 8f6156d..e58538c 100644
@@ -161,7 +161,7 @@
 	CLK_LOW
 };     
 
-static struct atmdev_ops he_ops =
+static const struct atmdev_ops he_ops =
 {
 	.open =		he_open,
 	.close =	he_close,	
drivers/atm/idt77252.c +1 -1
index b7a168c..47f3c4a 100644
@@ -134,7 +134,7 @@ static int idt77252_proc_read(struct atm_dev *dev, loff_t * pos,
 static void idt77252_softint(struct work_struct *work);
 
 
-static struct atmdev_ops idt77252_ops =
+static const struct atmdev_ops idt77252_ops =
 {
 	.dev_close	= idt77252_dev_close,
 	.open		= idt77252_open,
drivers/atm/nicstar.c +1 -1
index 9588d80..a970283 100644
@@ -154,7 +154,7 @@ static void ns_phy_put(struct atm_dev *dev, unsigned char value,
 
 static struct ns_dev *cards[NS_MAX_CARDS];
 static unsigned num_cards;
-static struct atmdev_ops atm_ops = {
+static const struct atmdev_ops atm_ops = {
 	.open = ns_open,
 	.close = ns_close,
 	.ioctl = ns_ioctl,
drivers/atm/solos-pci.c +1 -1
index 8754793..0df1a1c 100644
@@ -1187,7 +1187,7 @@ static int psend(struct atm_vcc *vcc, struct sk_buff *skb)
 	return 0;
 }
 
-static struct atmdev_ops fpga_ops = {
+static const struct atmdev_ops fpga_ops = {
 	.open =		popen,
 	.close =	pclose,
 	.ioctl =	NULL,
Signature · 1 line
1.9.1
maintainer Applied
#1 lore raw

From: Bhumika Goyal <[email protected]>
Date: Wed, 9 Aug 2017 14:49:15 +0530

Quoted 6 lines

Make these structures const as they are either passed to the function atm_dev_register having the corresponding argument as const or stored in the ops field of a atm_dev structure, which is also const. Done using Coccinelle.

Applied.