Skip to contentSkip to conversation

net/ipx/: make some code static

PATCH Applied Adrian Bunk 3 participants 3 messages Dec 15, 2004 – Dec 28, 2004

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

PATCH 1/1 net/ipx/: make some code static

The patch below makes some needlessly global code static.

diffstat output:

 include/net/ipx.h  |    8 --------
 net/ipx/af_ipx.c   |   10 ++++++++--
 net/ipx/ipx_proc.c |    6 +++---
 3 files changed, 11 insertions(+), 13 deletions(-)
include/net/ipx.h renamed from include/net/ipx.h.old +0 -8
@@ -139,14 +139,6 @@
 		ipxitf_down(intrfc);
 }
 
-extern void __ipxitf_down(struct ipx_interface *intrfc);
-
-static __inline__ void __ipxitf_put(struct ipx_interface *intrfc)
-{
-	if (atomic_dec_and_test(&intrfc->refcnt))
-		__ipxitf_down(intrfc);
-}
-
 static __inline__ void ipxrtr_hold(struct ipx_route *rt)
 {
 	        atomic_inc(&rt->refcnt);
net/ipx/af_ipx.c renamed from net/ipx/af_ipx.c.old +8 -2
@@ -291,7 +291,7 @@
 }
 #endif
 
-void __ipxitf_down(struct ipx_interface *intrfc)
+static void __ipxitf_down(struct ipx_interface *intrfc)
 {
 	struct sock *s;
 	struct hlist_node *node, *t;
@@ -335,6 +335,12 @@
 	spin_unlock_bh(&ipx_interfaces_lock);
 }
 
+static __inline__ void __ipxitf_put(struct ipx_interface *intrfc)
+{
+	if (atomic_dec_and_test(&intrfc->refcnt))
+		__ipxitf_down(intrfc);
+}
+
 static int ipxitf_device_event(struct notifier_block *notifier,
 				unsigned long event, void *ptr)
 {
@@ -1629,7 +1635,7 @@
 	return rc;
 }
 
-int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
+static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
 {
 	/* NULL here for pt means the packet was looped back */
 	struct ipx_interface *intrfc;
net/ipx/ipx_proc.c renamed from net/ipx/ipx_proc.c.old +3 -3
@@ -287,21 +287,21 @@
 	return 0;
 }
 
-struct seq_operations ipx_seq_interface_ops = {
+static struct seq_operations ipx_seq_interface_ops = {
 	.start  = ipx_seq_interface_start,
 	.next   = ipx_seq_interface_next,
 	.stop   = ipx_seq_interface_stop,
 	.show   = ipx_seq_interface_show,
 };
 
-struct seq_operations ipx_seq_route_ops = {
+static struct seq_operations ipx_seq_route_ops = {
 	.start  = ipx_seq_route_start,
 	.next   = ipx_seq_route_next,
 	.stop   = ipx_seq_route_stop,
 	.show   = ipx_seq_route_show,
 };
 
-struct seq_operations ipx_seq_socket_ops = {
+static struct seq_operations ipx_seq_socket_ops = {
 	.start  = ipx_seq_socket_start,
 	.next   = ipx_seq_socket_next,
 	.stop   = ipx_seq_interface_stop,
#1 lore raw

ACKed, this was because a long time ago I planned to ressurect the SPX code.

- Arnaldo

Quoted 91 lines · Adrian Bunk

The patch below makes some needlessly global code static.

diffstat output:

 include/net/ipx.h  |    8 --------
 net/ipx/af_ipx.c   |   10 ++++++++--
 net/ipx/ipx_proc.c |    6 +++---
 3 files changed, 11 insertions(+), 13 deletions(-)
include/net/ipx.h renamed from include/net/ipx.h.old +0 -8
@@ -139,14 +139,6 @@
 		ipxitf_down(intrfc);
 }
 
-extern void __ipxitf_down(struct ipx_interface *intrfc);
-
-static __inline__ void __ipxitf_put(struct ipx_interface *intrfc)
-{
-	if (atomic_dec_and_test(&intrfc->refcnt))
-		__ipxitf_down(intrfc);
-}
-
 static __inline__ void ipxrtr_hold(struct ipx_route *rt)
 {
 	        atomic_inc(&rt->refcnt);
net/ipx/af_ipx.c renamed from net/ipx/af_ipx.c.old +8 -2
@@ -291,7 +291,7 @@
 }
 #endif
 
-void __ipxitf_down(struct ipx_interface *intrfc)
+static void __ipxitf_down(struct ipx_interface *intrfc)
 {
 	struct sock *s;
 	struct hlist_node *node, *t;
@@ -335,6 +335,12 @@
 	spin_unlock_bh(&ipx_interfaces_lock);
 }
 
+static __inline__ void __ipxitf_put(struct ipx_interface *intrfc)
+{
+	if (atomic_dec_and_test(&intrfc->refcnt))
+		__ipxitf_down(intrfc);
+}
+
 static int ipxitf_device_event(struct notifier_block *notifier,
 				unsigned long event, void *ptr)
 {
@@ -1629,7 +1635,7 @@
 	return rc;
 }
 
-int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
+static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
 {
 	/* NULL here for pt means the packet was looped back */
 	struct ipx_interface *intrfc;
net/ipx/ipx_proc.c renamed from net/ipx/ipx_proc.c.old +3 -3
@@ -287,21 +287,21 @@
 	return 0;
 }
 
-struct seq_operations ipx_seq_interface_ops = {
+static struct seq_operations ipx_seq_interface_ops = {
 	.start  = ipx_seq_interface_start,
 	.next   = ipx_seq_interface_next,
 	.stop   = ipx_seq_interface_stop,
 	.show   = ipx_seq_interface_show,
 };
 
-struct seq_operations ipx_seq_route_ops = {
+static struct seq_operations ipx_seq_route_ops = {
 	.start  = ipx_seq_route_start,
 	.next   = ipx_seq_route_next,
 	.stop   = ipx_seq_route_stop,
 	.show   = ipx_seq_route_show,
 };
 
-struct seq_operations ipx_seq_socket_ops = {
+static struct seq_operations ipx_seq_socket_ops = {
 	.start  = ipx_seq_socket_start,
 	.next   = ipx_seq_socket_next,
 	.stop   = ipx_seq_interface_stop,