net/802/: some cleanups
Subsystems (2)
PATCH 1/1 net/802/: some cleanups
The patch below contains the following cleanups:
- make some needlessly global code static
- net/802/hippi.c: remove the unused global function hippi_net_init
- net/8021q/vlan.c: remove the global variable vlan_default_dev_flags that was never changed
- drivers/net/net_init.c: remove four unneeded #include's
diffstat output:
drivers/net/fc/iph5526_ip.h | 1 - drivers/net/net_init.c | 4 ---- include/linux/fcdevice.h | 4 ---- include/linux/fddidevice.h | 7 ------- include/linux/hippidevice.h | 21 --------------------- include/linux/trdevice.h | 4 ---- net/802/fc.c | 7 ++++--- net/802/fddi.c | 7 ++++--- net/802/hippi.c | 19 ++++--------------- net/802/tr.c | 7 ++++--- net/8021q/vlan.c | 9 +++------ net/8021q/vlan.h | 1 - net/8021q/vlanproc.c | 2 +- 13 files changed, 20 insertions(+), 73 deletions(-)
include/linux/fcdevice.h renamed from include/linux/fcdevice.h.old +0 -4
@@ -27,10 +27,6 @@#include <linux/if_fc.h> #ifdef __KERNEL__ -extern int fc_header (struct sk_buff *skb,struct net_device *dev, -unsigned short type,void *daddr, -void *saddr,unsigned len); -extern int fc_rebuild_header (struct sk_buff *skb);extern unsigned short fc_type_trans (struct sk_buff *skb,struct net_device *dev);extern struct net_device *alloc_fcdev (int sizeof_priv);
net/802/fc.c renamed from net/802/fc.c.old +4 -3
@@ -35,8 +35,9 @@* Put the headers on a Fibre Channel packet. */ -int fc_header (struct sk_buff *skb,struct net_device *dev,unsigned short type, -void *daddr,void *saddr,unsigned len) +static int fc_header (struct sk_buff *skb,struct net_device *dev, +unsigned short type, +void *daddr,void *saddr,unsigned len) {struct fch_hdr *fch;int hdr_len;
@@ -81,7 +82,7 @@* can now send the packet. */ -int fc_rebuild_header (struct sk_buff *skb) +static int fc_rebuild_header (struct sk_buff *skb) {struct fch_hdr *fch=(struct fch_hdr *)skb->data;struct fcllc *fcllc=(struct fcllc *)(skb->data+sizeof (struct fch_hdr ));
drivers/net/fc/iph5526_ip.h renamed from drivers/net/fc/iph5526_ip.h.old +0 -1
@@ -18,7 +18,6 @@static void rx_net_packet (struct fc_info *fi,u_char *buff_addr,int payload_size);static void rx_net_mfs_packet (struct fc_info *fi,struct sk_buff *skb); -unsigned short fc_type_trans (struct sk_buff *skb,struct net_device *dev);static int tx_ip_packet (struct sk_buff *skb,unsigned long len,struct fc_info *fi);static int tx_arp_packet (char *data,unsigned long len,struct fc_info *fi);#endif
drivers/net/net_init.c renamed from drivers/net/net_init.c.old +0 -4
@@ -43,10 +43,6 @@#include <linux/string.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> -#include <linux/fddidevice.h> -#include <linux/hippidevice.h> -#include <linux/trdevice.h> -#include <linux/fcdevice.h> #include <linux/if_arp.h> #include <linux/if_ltalk.h> #include <linux/rtnetlink.h>
include/linux/fddidevice.h renamed from include/linux/fddidevice.h.old +0 -7
@@ -25,13 +25,6 @@#include <linux/if_fddi.h> #ifdef __KERNEL__ -extern int fddi_header (struct sk_buff *skb, -struct net_device *dev, -unsigned short type, -void *daddr, -void *saddr, -unsigned len); -extern int fddi_rebuild_header (struct sk_buff *skb);extern unsigned short fddi_type_trans (struct sk_buff *skb,struct net_device *dev);extern struct net_device *alloc_fddidev (int sizeof_priv);
net/802/fddi.c renamed from net/802/fddi.c.old +4 -3
@@ -52,8 +52,9 @@* daddr=NULL means leave destination address (eg unresolved arp) */ -int fddi_header (struct sk_buff *skb,struct net_device *dev,unsigned short type, -void *daddr,void *saddr,unsigned len) +static int fddi_header (struct sk_buff *skb,struct net_device *dev, +unsigned short type, +void *daddr,void *saddr,unsigned len) {int hl =FDDI_K_SNAP_HLEN ;struct fddihdr *fddi;
@@ -96,7 +97,7 @@* this sk_buff. We now let ARP fill in the other fields. */ -int fddi_rebuild_header (struct sk_buff *skb) +static int fddi_rebuild_header (struct sk_buff *skb) {struct fddihdr *fddi = (struct fddihdr *)skb->data;
include/linux/hippidevice.h renamed from include/linux/hippidevice.h.old +0 -21
@@ -26,30 +26,9 @@#include <linux/if_hippi.h> #ifdef __KERNEL__ -extern int hippi_header (struct sk_buff *skb, -struct net_device *dev, -unsigned short type, -void *daddr, -void *saddr, -unsigned len); - -extern int hippi_rebuild_header (struct sk_buff *skb); -extern unsigned short hippi_type_trans (struct sk_buff *skb,struct net_device *dev); -extern void hippi_header_cache_bind (struct hh_cache ** hhp, -struct net_device *dev, -unsigned short htype, -__u32 daddr); - -extern void hippi_header_cache_update (struct hh_cache *hh, -struct net_device *dev, -unsigned char * haddr); -extern int hippi_header_parse (struct sk_buff *skb,unsigned char *haddr); - -extern void hippi_net_init (void ); -extern struct net_device *alloc_hippi_dev (int sizeof_priv);#endif
net/802/hippi.c renamed from net/802/hippi.c.old +4 -15
@@ -40,26 +40,15 @@#include <asm/system.h> /* -* hippi_net_init() -* -* Do nothing, this is just to pursuade the stupid linker to behave. -*/ - -void hippi_net_init (void ) -{ -return ; -} - -/* * Create the HIPPI MAC header for an arbitrary protocol layer * * saddr=NULL means use device source address * daddr=NULL means leave destination address (eg unresolved arp) */ -int hippi_header (struct sk_buff *skb,struct net_device *dev, -unsigned short type,void *daddr,void *saddr, -unsigned len) +static int hippi_header (struct sk_buff *skb,struct net_device *dev, +unsigned short type,void *daddr,void *saddr, +unsigned len) {struct hippi_hdr *hip = (struct hippi_hdr *)skb_push (skb,HIPPI_HLEN );
@@ -107,7 +96,7 @@* completed on this sk_buff. We now let ARP fill in the other fields. */ -int hippi_rebuild_header (struct sk_buff *skb) +static int hippi_rebuild_header (struct sk_buff *skb) {struct hippi_hdr *hip = (struct hippi_hdr *)skb->data;
include/linux/trdevice.h renamed from include/linux/trdevice.h.old +0 -4
@@ -28,10 +28,6 @@#include <linux/if_tr.h> #ifdef __KERNEL__ -extern int tr_header (struct sk_buff *skb,struct net_device *dev, -unsigned short type,void *daddr, -void *saddr,unsigned len); -extern int tr_rebuild_header (struct sk_buff *skb);extern unsigned short tr_type_trans (struct sk_buff *skb,struct net_device *dev);extern void tr_source_route (struct sk_buff *skb,struct trh_hdr *trh,struct net_device *dev);extern struct net_device *alloc_trdev (int sizeof_priv);
net/802/tr.c renamed from net/802/tr.c.old +4 -3
@@ -98,8 +98,9 @@* makes this a little more exciting than on ethernet. */ -int tr_header (struct sk_buff *skb,struct net_device *dev,unsigned short type, -void *daddr,void *saddr,unsigned len) +static int tr_header (struct sk_buff *skb,struct net_device *dev, +unsigned short type, +void *daddr,void *saddr,unsigned len) {struct trh_hdr *trh;int hdr_len;
@@ -153,7 +154,7 @@* can now send the packet. */ -int tr_rebuild_header (struct sk_buff *skb) +static int tr_rebuild_header (struct sk_buff *skb) {struct trh_hdr *trh=(struct trh_hdr *)skb->data;struct trllc *trllc=(struct trllc *)(skb->data+sizeof (struct trh_hdr ));
net/8021q/vlan.h renamed from net/8021q/vlan.h.old +0 -1
@@ -33,7 +33,6 @@#define VLAN_GRP_HASH_SHIFT 5#define VLAN_GRP_HASH_SIZE (1 << VLAN_GRP_HASH_SHIFT)#define VLAN_GRP_HASH_MASK (VLAN_GRP_HASH_SIZE - 1) -extern struct hlist_head vlan_group_hash[VLAN_GRP_HASH_SIZE ];/* Find a VLAN device by the MAC address of its Ethernet device, and * it's VLAN ID. The default configuration is to have VLAN's scope
net/8021q/vlan.c renamed from net/8021q/vlan.c.old +3 -6
@@ -40,7 +40,7 @@/* Global VLAN variables */ /* Our listing of VLAN group(s) */ -struct hlist_head vlan_group_hash[VLAN_GRP_HASH_SIZE ]; +static struct hlist_head vlan_group_hash[VLAN_GRP_HASH_SIZE ];#define vlan_grp_hashfn (IDX ) ((((IDX) >> VLAN_GRP_HASH_SHIFT) ^ (IDX)) & VLAN_GRP_HASH_MASK)static char vlan_fullname[] ="802.1Q VLAN Support" ;
@@ -52,7 +52,7 @@static int vlan_ioctl_handler (void __user *);static int unregister_vlan_dev (struct net_device *,unsigned short ); -struct notifier_block vlan_notifier_block = { +static struct notifier_block vlan_notifier_block = { .notifier_call = vlan_device_event, };
@@ -61,9 +61,6 @@/* Determines interface naming scheme. */ unsigned short vlan_name_type =VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD ; -/* DO reorder the header by default */ -unsigned short vlan_default_dev_flags =1 ; -static struct packet_type vlan_packet_type = { .type =__constant_htons (ETH_P_8021Q ), .func = vlan_skb_recv,/* VLAN receive method */
@@ -490,7 +487,7 @@VLAN_DEV_INFO (new_dev)->vlan_id =VLAN_ID ;/* 1 through VLAN_VID_MASK */ VLAN_DEV_INFO (new_dev)->real_dev = real_dev;VLAN_DEV_INFO (new_dev)->dent =NULL ; -VLAN_DEV_INFO (new_dev)->flags = vlan_default_dev_flags; +VLAN_DEV_INFO (new_dev)->flags =1 ;#ifdef VLAN_DEBUG printk(VLAN_DBG "About to go find the group for idx: %i\n",
net/8021q/vlanproc.c renamed from net/8021q/vlanproc.c.old +1 -1
@@ -239,7 +239,7 @@*/ /* starting at dev, find a VLAN device */ -struct net_device *vlan_skip (struct net_device *dev) +static struct net_device *vlan_skip (struct net_device *dev) {while (dev && !(dev->priv_flags &IFF_802_1Q_VLAN )) dev = dev->next;
David S. Miller
maintainerQuoted 6 lines · On Sun, 12 Dec 2004 21:11:15 +0100 Adrian Bunk <[email protected]> wrote:
The patch below contains the following cleanups:
- make some needlessly global code static
-net/802/hippi.c: remove the unused global functionhippi_net_init
-net/8021q/vlan.c: remove the global variablevlan_default_dev_flagsthat was never changed
-drivers/net/net_init.c: remove four unneeded #include's
drivers/net/net_init.c no longer exists in the source tree :)
PATCH 1/1 net/802/: some cleanups
Quoted 2 lines · David S. Miller
drivers/net/net_init.cno longer exists in the source tree :)
Updated patch:
<-- snip -->
This patch contains the following cleanups:
- make some needlessly global code static
- net/802/hippi.c: remove the unused global function hippi_net_init
- net/8021q/vlan.c: remove the global variable vlan_default_dev_flags that was never changed
---
diffstat output:
drivers/net/fc/iph5526_ip.h | 1 - include/linux/fcdevice.h | 4 ---- include/linux/fddidevice.h | 7 ------- include/linux/hippidevice.h | 21 --------------------- include/linux/trdevice.h | 4 ---- net/802/fc.c | 7 ++++--- net/802/fddi.c | 7 ++++--- net/802/hippi.c | 19 ++++--------------- net/802/tr.c | 7 ++++--- net/8021q/vlan.c | 9 +++------ net/8021q/vlan.h | 1 - net/8021q/vlanproc.c | 2 +- 12 files changed, 20 insertions(+), 69 deletions(-)
include/linux/fcdevice.h renamed from include/linux/fcdevice.h.old +0 -4
@@ -27,10 +27,6 @@#include <linux/if_fc.h> #ifdef __KERNEL__ -extern int fc_header (struct sk_buff *skb,struct net_device *dev, -unsigned short type,void *daddr, -void *saddr,unsigned len); -extern int fc_rebuild_header (struct sk_buff *skb);extern unsigned short fc_type_trans (struct sk_buff *skb,struct net_device *dev);extern struct net_device *alloc_fcdev (int sizeof_priv);
net/802/fc.c renamed from net/802/fc.c.old +4 -3
@@ -35,8 +35,9 @@* Put the headers on a Fibre Channel packet. */ -int fc_header (struct sk_buff *skb,struct net_device *dev,unsigned short type, -void *daddr,void *saddr,unsigned len) +static int fc_header (struct sk_buff *skb,struct net_device *dev, +unsigned short type, +void *daddr,void *saddr,unsigned len) {struct fch_hdr *fch;int hdr_len;
@@ -81,7 +82,7 @@* can now send the packet. */ -int fc_rebuild_header (struct sk_buff *skb) +static int fc_rebuild_header (struct sk_buff *skb) {struct fch_hdr *fch=(struct fch_hdr *)skb->data;struct fcllc *fcllc=(struct fcllc *)(skb->data+sizeof (struct fch_hdr ));
drivers/net/fc/iph5526_ip.h renamed from drivers/net/fc/iph5526_ip.h.old +0 -1
@@ -18,7 +18,6 @@static void rx_net_packet (struct fc_info *fi,u_char *buff_addr,int payload_size);static void rx_net_mfs_packet (struct fc_info *fi,struct sk_buff *skb); -unsigned short fc_type_trans (struct sk_buff *skb,struct net_device *dev);static int tx_ip_packet (struct sk_buff *skb,unsigned long len,struct fc_info *fi);static int tx_arp_packet (char *data,unsigned long len,struct fc_info *fi);#endif
include/linux/fddidevice.h renamed from include/linux/fddidevice.h.old +0 -7
@@ -25,13 +25,6 @@#include <linux/if_fddi.h> #ifdef __KERNEL__ -extern int fddi_header (struct sk_buff *skb, -struct net_device *dev, -unsigned short type, -void *daddr, -void *saddr, -unsigned len); -extern int fddi_rebuild_header (struct sk_buff *skb);extern unsigned short fddi_type_trans (struct sk_buff *skb,struct net_device *dev);extern struct net_device *alloc_fddidev (int sizeof_priv);
net/802/fddi.c renamed from net/802/fddi.c.old +4 -3
@@ -52,8 +52,9 @@* daddr=NULL means leave destination address (eg unresolved arp) */ -int fddi_header (struct sk_buff *skb,struct net_device *dev,unsigned short type, -void *daddr,void *saddr,unsigned len) +static int fddi_header (struct sk_buff *skb,struct net_device *dev, +unsigned short type, +void *daddr,void *saddr,unsigned len) {int hl =FDDI_K_SNAP_HLEN ;struct fddihdr *fddi;
@@ -96,7 +97,7 @@* this sk_buff. We now let ARP fill in the other fields. */ -int fddi_rebuild_header (struct sk_buff *skb) +static int fddi_rebuild_header (struct sk_buff *skb) {struct fddihdr *fddi = (struct fddihdr *)skb->data;
include/linux/hippidevice.h renamed from include/linux/hippidevice.h.old +0 -21
@@ -26,30 +26,9 @@#include <linux/if_hippi.h> #ifdef __KERNEL__ -extern int hippi_header (struct sk_buff *skb, -struct net_device *dev, -unsigned short type, -void *daddr, -void *saddr, -unsigned len); - -extern int hippi_rebuild_header (struct sk_buff *skb); -extern unsigned short hippi_type_trans (struct sk_buff *skb,struct net_device *dev); -extern void hippi_header_cache_bind (struct hh_cache ** hhp, -struct net_device *dev, -unsigned short htype, -__u32 daddr); - -extern void hippi_header_cache_update (struct hh_cache *hh, -struct net_device *dev, -unsigned char * haddr); -extern int hippi_header_parse (struct sk_buff *skb,unsigned char *haddr); - -extern void hippi_net_init (void ); -extern struct net_device *alloc_hippi_dev (int sizeof_priv);#endif
net/802/hippi.c renamed from net/802/hippi.c.old +4 -15
@@ -40,26 +40,15 @@#include <asm/system.h> /* -* hippi_net_init() -* -* Do nothing, this is just to pursuade the stupid linker to behave. -*/ - -void hippi_net_init (void ) -{ -return ; -} - -/* * Create the HIPPI MAC header for an arbitrary protocol layer * * saddr=NULL means use device source address * daddr=NULL means leave destination address (eg unresolved arp) */ -int hippi_header (struct sk_buff *skb,struct net_device *dev, -unsigned short type,void *daddr,void *saddr, -unsigned len) +static int hippi_header (struct sk_buff *skb,struct net_device *dev, +unsigned short type,void *daddr,void *saddr, +unsigned len) {struct hippi_hdr *hip = (struct hippi_hdr *)skb_push (skb,HIPPI_HLEN );
@@ -107,7 +96,7 @@* completed on this sk_buff. We now let ARP fill in the other fields. */ -int hippi_rebuild_header (struct sk_buff *skb) +static int hippi_rebuild_header (struct sk_buff *skb) {struct hippi_hdr *hip = (struct hippi_hdr *)skb->data;
include/linux/trdevice.h renamed from include/linux/trdevice.h.old +0 -4
@@ -28,10 +28,6 @@#include <linux/if_tr.h> #ifdef __KERNEL__ -extern int tr_header (struct sk_buff *skb,struct net_device *dev, -unsigned short type,void *daddr, -void *saddr,unsigned len); -extern int tr_rebuild_header (struct sk_buff *skb);extern unsigned short tr_type_trans (struct sk_buff *skb,struct net_device *dev);extern void tr_source_route (struct sk_buff *skb,struct trh_hdr *trh,struct net_device *dev);extern struct net_device *alloc_trdev (int sizeof_priv);
net/802/tr.c renamed from net/802/tr.c.old +4 -3
@@ -98,8 +98,9 @@* makes this a little more exciting than on ethernet. */ -int tr_header (struct sk_buff *skb,struct net_device *dev,unsigned short type, -void *daddr,void *saddr,unsigned len) +static int tr_header (struct sk_buff *skb,struct net_device *dev, +unsigned short type, +void *daddr,void *saddr,unsigned len) {struct trh_hdr *trh;int hdr_len;
@@ -153,7 +154,7 @@* can now send the packet. */ -int tr_rebuild_header (struct sk_buff *skb) +static int tr_rebuild_header (struct sk_buff *skb) {struct trh_hdr *trh=(struct trh_hdr *)skb->data;struct trllc *trllc=(struct trllc *)(skb->data+sizeof (struct trh_hdr ));
net/8021q/vlan.h renamed from net/8021q/vlan.h.old +0 -1
@@ -33,7 +33,6 @@#define VLAN_GRP_HASH_SHIFT 5#define VLAN_GRP_HASH_SIZE (1 << VLAN_GRP_HASH_SHIFT)#define VLAN_GRP_HASH_MASK (VLAN_GRP_HASH_SIZE - 1) -extern struct hlist_head vlan_group_hash[VLAN_GRP_HASH_SIZE ];/* Find a VLAN device by the MAC address of its Ethernet device, and * it's VLAN ID. The default configuration is to have VLAN's scope
net/8021q/vlan.c renamed from net/8021q/vlan.c.old +3 -6
@@ -40,7 +40,7 @@/* Global VLAN variables */ /* Our listing of VLAN group(s) */ -struct hlist_head vlan_group_hash[VLAN_GRP_HASH_SIZE ]; +static struct hlist_head vlan_group_hash[VLAN_GRP_HASH_SIZE ];#define vlan_grp_hashfn (IDX ) ((((IDX) >> VLAN_GRP_HASH_SHIFT) ^ (IDX)) & VLAN_GRP_HASH_MASK)static char vlan_fullname[] ="802.1Q VLAN Support" ;
@@ -52,7 +52,7 @@static int vlan_ioctl_handler (void __user *);static int unregister_vlan_dev (struct net_device *,unsigned short ); -struct notifier_block vlan_notifier_block = { +static struct notifier_block vlan_notifier_block = { .notifier_call = vlan_device_event, };
@@ -61,9 +61,6 @@/* Determines interface naming scheme. */ unsigned short vlan_name_type =VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD ; -/* DO reorder the header by default */ -unsigned short vlan_default_dev_flags =1 ; -static struct packet_type vlan_packet_type = { .type =__constant_htons (ETH_P_8021Q ), .func = vlan_skb_recv,/* VLAN receive method */
@@ -490,7 +487,7 @@VLAN_DEV_INFO (new_dev)->vlan_id =VLAN_ID ;/* 1 through VLAN_VID_MASK */ VLAN_DEV_INFO (new_dev)->real_dev = real_dev;VLAN_DEV_INFO (new_dev)->dent =NULL ; -VLAN_DEV_INFO (new_dev)->flags = vlan_default_dev_flags; +VLAN_DEV_INFO (new_dev)->flags =1 ;#ifdef VLAN_DEBUG printk(VLAN_DBG "About to go find the group for idx: %i\n",
net/8021q/vlanproc.c renamed from net/8021q/vlanproc.c.old +1 -1
@@ -239,7 +239,7 @@*/ /* starting at dev, find a VLAN device */ -struct net_device *vlan_skip (struct net_device *dev) +static struct net_device *vlan_skip (struct net_device *dev) {while (dev && !(dev->priv_flags &IFF_802_1Q_VLAN )) dev = dev->next;
Quoted 10 lines · On Mon, 17 Jan 2005 09:14:38 +0100 Adrian Bunk <[email protected]> wrote:
Quoted 2 lines · David S. Miller
drivers/net/net_init.cno longer exists in the source tree :)Updated patch:
<-- snip -->
Quoted 7 lines
This patch contains the following cleanups:
- make some needlessly global code static
-net/802/hippi.c: remove the unused global functionhippi_net_init
-net/8021q/vlan.c: remove the global variablevlan_default_dev_flagsthat was never changedSigned-off-by Adrian Bunk <[email protected]>
Applied, thanks Adrian.