Skip to contentSkip to conversation

drivers/net/lp486e.c: make some code static

PATCH In review Adrian Bunk 2 participants 3 messages Feb 17, 2005 – Feb 21, 2005 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/net/lp486e.c: make some code static

This patch makes some needlessly global code static.

---

 drivers/net/lp486e.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/net/lp486e.c renamed from drivers/net/lp486e.c.old +5 -3
@@ -112,8 +112,10 @@
 	CmdDiagnose = 7
 };
 
-char *CUcmdnames[8] = { "NOP", "IASetup", "Configure", "MulticastList",
-			"Tx", "TDR", "Dump", "Diagnose" };
+#if 0
+static char *CUcmdnames[8] = { "NOP", "IASetup", "Configure", "MulticastList",
+			       "Tx", "TDR", "Dump", "Diagnose" };
+#endif
 
 /* Status word bits */
 #define	STAT_CX		0x8000	/* The CU finished executing a command
@@ -960,7 +962,7 @@
 		(unsigned char) add[12], (unsigned char) add[13]);
 }
 
-int __init lp486e_probe(struct net_device *dev) {
+static int __init lp486e_probe(struct net_device *dev) {
 	struct i596_private *lp;
 	unsigned char eth_addr[6] = { 0, 0xaa, 0, 0, 0, 0 };
 	unsigned char *bios;
#1 lore raw
Quoted 12 lines · Adrian Bunk

This patch makes some needlessly global code static.

---

 drivers/net/lp486e.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

drivers/net/lp486e.c line 118

Quoted 9 lines
drivers/net/lp486e.c renamed from drivers/net/lp486e.c.old +4 -2
@@ -112,8 +112,10 @@
 	CmdDiagnose = 7
 };
 
-char *CUcmdnames[8] = { "NOP", "IASetup", "Configure", "MulticastList",
-			"Tx", "TDR", "Dump", "Diagnose" };
+#if 0
+static char *CUcmdnames[8] = { "NOP", "IASetup", "Configure", "MulticastList",
+			       "Tx", "TDR", "Dump", "Diagnose" };
+#endif

Need const.

Jeff

#2 lore raw

PATCH 1/1 drivers/net/lp486e.c: make some code static

Quoted 8 lines · Jeff Garzik

...

Review

Quoted 5 lines
(quoted diff) +2 -0
+#if 0
+static char *CUcmdnames[8] = { "NOP", "IASetup", "Configure", 

"MulticastList",

(quoted diff) +2 -0
+			       "Tx", "TDR", "Dump", "Diagnose" };
+#endif

Need const.

Updated patch:

<-- snip -->

This patch makes some needlessly global code static and makes CUcmdnames const.

---

 drivers/net/lp486e.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/net/lp486e.c renamed from drivers/net/lp486e.c.old +5 -3
@@ -112,8 +112,10 @@
 	CmdDiagnose = 7
 };
 
-char *CUcmdnames[8] = { "NOP", "IASetup", "Configure", "MulticastList",
-			"Tx", "TDR", "Dump", "Diagnose" };
+#if 0
+static const char *CUcmdnames[8] = { "NOP", "IASetup", "Configure", "MulticastList",
+				     "Tx", "TDR", "Dump", "Diagnose" };
+#endif
 
 /* Status word bits */
 #define	STAT_CX		0x8000	/* The CU finished executing a command
@@ -960,7 +962,7 @@
 		(unsigned char) add[12], (unsigned char) add[13]);
 }
 
-int __init lp486e_probe(struct net_device *dev) {
+static int __init lp486e_probe(struct net_device *dev) {
 	struct i596_private *lp;
 	unsigned char eth_addr[6] = { 0, 0xaa, 0, 0, 0, 0 };
 	unsigned char *bios;