diff --git a/net/802/fc.c b/net/802/fc.c
index 2a27e37..d64e6a5 100644
--- a/net/802/fc.c
+++ b/net/802/fc.c
@@ -1,6 +1,6 @@
 /*
  * NET3:	Fibre Channel device handling subroutines
- * 
+ *
  *		This program is free software; you can redistribute it and/or
  *		modify it under the terms of the GNU General Public License
  *		as published by the Free Software Foundation; either version
@@ -31,18 +31,18 @@
 #include <net/arp.h>
 
 /*
- *	Put the headers on a Fibre Channel packet. 
+ *	Put the headers on a Fibre Channel packet.
  */
- 
+
 static int fc_header(struct sk_buff *skb, struct net_device *dev,
 		     unsigned short type,
-		     void *daddr, void *saddr, unsigned len) 
+		     void *daddr, void *saddr, unsigned len)
 {
 	struct fch_hdr *fch;
 	int hdr_len;
 
-	/* 
-	 * Add the 802.2 SNAP header if IP as the IPv4 code calls  
+	/*
+	 * Add the 802.2 SNAP header if IP as the IPv4 code calls
 	 * dev->hard_header directly.
 	 */
 	if (type == ETH_P_IP || type == ETH_P_ARP)
@@ -60,7 +60,7 @@
 	else
 	{
 		hdr_len = sizeof(struct fch_hdr);
-		fch = (struct fch_hdr *)skb_push(skb, hdr_len);	
+		fch = (struct fch_hdr *)skb_push(skb, hdr_len);
 	}
 
 	if(saddr)
@@ -68,20 +68,20 @@
 	else
 		memcpy(fch->saddr,dev->dev_addr,dev->addr_len);
 
-	if(daddr) 
+	if(daddr)
 	{
 		memcpy(fch->daddr,daddr,dev->addr_len);
 		return(hdr_len);
 	}
 	return -hdr_len;
 }
-	
+
 /*
  *	A neighbour discovery of some species (eg arp) has completed. We
  *	can now send the packet.
  */
- 
-static 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));
@@ -100,7 +100,7 @@
 {
 	dev->hard_header	= fc_header;
 	dev->rebuild_header	= fc_rebuild_header;
-                
+
 	dev->type		= ARPHRD_IEEE802;
 	dev->hard_header_len	= FC_HLEN;
 	dev->mtu		= 2024;
diff --git a/net/802/fddi.c b/net/802/fddi.c
index 797c6d9..0b98fe2 100644
--- a/net/802/fddi.c
+++ b/net/802/fddi.c
@@ -15,7 +15,7 @@
  *			Mark Evans, <evansmp@uhura.aston.ac.uk>
  *			Florian La Roche, <rzsfl@rz.uni-sb.de>
  *			Alan Cox, <gw4pts@gw4pts.ampr.org>
- * 
+ *
  *		This program is free software; you can redistribute it and/or
  *		modify it under the terms of the GNU General Public License
  *		as published by the Free Software Foundation; either version
@@ -25,7 +25,7 @@
  *		Alan Cox		:	New arp/rebuild header
  *		Maciej W. Rozycki	:	IPv6 support
  */
- 
+
 #include <linux/module.h>
 #include <asm/system.h>
 #include <linux/types.h>
@@ -57,7 +57,7 @@
 {
 	int hl = FDDI_K_SNAP_HLEN;
 	struct fddihdr *fddi;
-	
+
 	if(type != ETH_P_IP && type != ETH_P_IPV6 && type != ETH_P_ARP)
 		hl=FDDI_K_8022_HLEN-3;
 	fddi = (struct fddihdr *)skb_push(skb, hl);
@@ -74,7 +74,7 @@
 	}
 
 	/* Set the source and destination hardware addresses */
-	 
+
 	if (saddr != NULL)
 		memcpy(fddi->saddr, saddr, dev->addr_len);
 	else
@@ -95,7 +95,7 @@
  * (or in future other address resolution) has completed on
  * this sk_buff.  We now let ARP fill in the other fields.
  */
- 
+
 static int fddi_rebuild_header(struct sk_buff	*skb)
 {
 	struct fddihdr *fddi = (struct fddihdr *)skb->data;
@@ -105,7 +105,7 @@
 		/* Try to get ARP to resolve the header and fill destination address */
 		return arp_find(fddi->daddr, skb);
 	else
-#endif	
+#endif
 	{
 		printk("%s: Don't know how to resolve type %04X addresses.\n",
 		       skb->dev->name, ntohs(fddi->hdr.llc_snap.ethertype));
@@ -120,19 +120,19 @@
  * up.  It's used to fill in specific skb fields and to set
  * the proper pointer to the start of packet data (skb->data).
  */
- 
+
 __be16 fddi_type_trans(struct sk_buff *skb, struct net_device *dev)
 {
 	struct fddihdr *fddi = (struct fddihdr *)skb->data;
 	__be16 type;
-	
+
 	/*
 	 * Set mac.raw field to point to FC byte, set data field to point
 	 * to start of packet data.  Assume 802.2 SNAP frames for now.
 	 */
 
 	skb->mac.raw = skb->data;	/* point to frame control (FC) */
-	
+
 	if(fddi->hdr.llc_8022_1.dsap==0xe0)
 	{
 		skb_pull(skb, FDDI_K_8022_HLEN-3);
@@ -143,9 +143,9 @@
 		skb_pull(skb, FDDI_K_SNAP_HLEN);		/* adjust for 21 byte header */
 		type=fddi->hdr.llc_snap.ethertype;
 	}
-	
+
 	/* Set packet type based on destination address and flag settings */
-			
+
 	if (*fddi->daddr & 0x01)
 	{
 		if (memcmp(fddi->daddr, dev->broadcast, FDDI_K_ALEN) == 0)
@@ -153,7 +153,7 @@
 		else
 			skb->pkt_type = PACKET_MULTICAST;
 	}
-	
+
 	else if (dev->flags & IFF_PROMISC)
 	{
 		if (memcmp(fddi->daddr, dev->dev_addr, FDDI_K_ALEN))
@@ -187,7 +187,7 @@
 	dev->addr_len		= FDDI_K_ALEN;
 	dev->tx_queue_len	= 100;			/* Long queues on FDDI */
 	dev->flags		= IFF_BROADCAST | IFF_MULTICAST;
-	
+
 	memset(dev->broadcast, 0xFF, FDDI_K_ALEN);
 }
 
diff --git a/net/802/hippi.c b/net/802/hippi.c
index 579e2dd..be0da59 100644
--- a/net/802/hippi.c
+++ b/net/802/hippi.c
@@ -39,7 +39,7 @@
 #include <asm/system.h>
 
 /*
- * Create the HIPPI MAC header for an arbitrary protocol layer 
+ * 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)
@@ -104,8 +104,8 @@
 	/*
 	 * Only IP is currently supported
 	 */
-	 
-	if(hip->snap.ethertype != __constant_htons(ETH_P_IP)) 
+
+	if(hip->snap.ethertype != __constant_htons(ETH_P_IP))
 	{
 		printk(KERN_DEBUG "%s: unable to resolve type %X addresses.\n",skb->dev->name,ntohs(hip->snap.ethertype));
 		return 0;
@@ -122,11 +122,11 @@
 /*
  *	Determine the packet's protocol ID.
  */
- 
+
 __be16 hippi_type_trans(struct sk_buff *skb, struct net_device *dev)
 {
 	struct hippi_hdr *hip;
-	
+
 	hip = (struct hippi_hdr *) skb->data;
 
 	/*
@@ -173,10 +173,10 @@
 {
 	/* Never send broadcast/multicast ARP messages */
 	p->mcast_probes = 0;
- 
+
 	/* In IPv6 unicast probes are valid even on NBMA,
 	* because they are encapsulated in normal IPv6 protocol.
-	* Should be a generic flag. 
+	* Should be a generic flag.
 	*/
 	if (p->tbl->family != AF_INET6)
 		p->ucast_probes = 0;
@@ -193,7 +193,7 @@
 	dev->hard_header_parse		= NULL;
 	dev->hard_header_cache		= NULL;
 	dev->header_cache_update	= NULL;
-	dev->neigh_setup 		= hippi_neigh_setup_dev; 
+	dev->neigh_setup 		= hippi_neigh_setup_dev;
 
 	/*
 	 * We don't support HIPPI `ARP' for the time being, and probably
@@ -210,9 +210,9 @@
 
 	/*
 	 * HIPPI doesn't support broadcast+multicast and we only use
-	 * static ARP tables. ARP is disabled by hippi_neigh_setup_dev. 
+	 * static ARP tables. ARP is disabled by hippi_neigh_setup_dev.
 	 */
-	dev->flags = 0; 
+	dev->flags = 0;
 }
 
 /**
diff --git a/net/802/psnap.c b/net/802/psnap.c
index 270b9d2..6e7c212 100644
--- a/net/802/psnap.c
+++ b/net/802/psnap.c
@@ -117,7 +117,7 @@
  */
 struct datalink_proto *register_snap_client(unsigned char *desc,
 					    int (*rcvfunc)(struct sk_buff *,
-						    	   struct net_device *,
+							   struct net_device *,
 							   struct packet_type *,
 							   struct net_device *))
 {
diff --git a/net/802/tr.c b/net/802/tr.c
index 829deb4..31509f6 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -1,6 +1,6 @@
 /*
  * NET3:	Token ring device handling subroutines
- * 
+ *
  *		This program is free software; you can redistribute it and/or
  *		modify it under the terms of the GNU General Public License
  *		as published by the Free Software Foundation; either version
@@ -12,7 +12,7 @@
  *              22 Jun 98 Paul Norton <p.norton@computer.org> Rearranged
  *              tr_header and tr_type_trans to handle passing IPX SNAP and
  *              802.2 through the correct layers. Eliminated tr_reformat.
- *        
+ *
  */
 
 #include <asm/uaccess.h>
@@ -45,7 +45,7 @@
 /*
  *	Each RIF entry we learn is kept this way
  */
- 
+
 struct rif_cache {
 	unsigned char addr[TR_ALEN];
 	int iface;
@@ -62,7 +62,7 @@
  *	We hash the RIF cache 32 ways. We do after all have to look it
  *	up a lot.
  */
- 
+
 static struct rif_cache *rif_table[RIF_TABLE_SIZE];
 
 static DEFINE_SPINLOCK(rif_lock);
@@ -71,7 +71,7 @@
 /*
  *	Garbage disposal timer.
  */
- 
+
 static struct timer_list rif_timer;
 
 int sysctl_tr_rif_timeout = 60*10*HZ;
@@ -96,16 +96,16 @@
  *	Put the headers on a token ring packet. Token ring source routing
  *	makes this a little more exciting than on ethernet.
  */
- 
+
 static int tr_header(struct sk_buff *skb, struct net_device *dev,
 		     unsigned short type,
-		     void *daddr, void *saddr, unsigned len) 
+		     void *daddr, void *saddr, unsigned len)
 {
 	struct trh_hdr *trh;
 	int hdr_len;
 
-	/* 
-	 * Add the 802.2 SNAP header if IP as the IPv4/IPv6 code calls  
+	/*
+	 * Add the 802.2 SNAP header if IP as the IPv4/IPv6 code calls
 	 * dev->hard_header directly.
 	 */
 	if (type == ETH_P_IP || type == ETH_P_IPV6 || type == ETH_P_ARP)
@@ -123,7 +123,7 @@
 	else
 	{
 		hdr_len = sizeof(struct trh_hdr);
-		trh = (struct trh_hdr *)skb_push(skb, hdr_len);	
+		trh = (struct trh_hdr *)skb_push(skb, hdr_len);
 	}
 
 	trh->ac=AC;
@@ -137,8 +137,8 @@
 	/*
 	 *	Build the destination and then source route the frame
 	 */
-	 
-	if(daddr) 
+
+	if(daddr)
 	{
 		memcpy(trh->daddr,daddr,dev->addr_len);
 		tr_source_route(skb,trh,dev);
@@ -147,13 +147,13 @@
 
 	return -hdr_len;
 }
-	
+
 /*
  *	A neighbour discovery of some species (eg arp) has completed. We
  *	can now send the packet.
  */
- 
-static 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));
@@ -162,7 +162,7 @@
 	/*
 	 *	FIXME: We don't yet support IPv6 over token rings
 	 */
-	 
+
 	if(trllc->ethertype != htons(ETH_P_IP)) {
 		printk("tr_rebuild_header: Don't know how to resolve type %04X addresses ?\n", ntohs(trllc->ethertype));
 		return 0;
@@ -172,39 +172,39 @@
 	if(arp_find(trh->daddr, skb)) {
 			return 1;
 	}
-	else 
-#endif	
-	{	
-		tr_source_route(skb,trh,dev); 
+	else
+#endif
+	{
+		tr_source_route(skb,trh,dev);
 		return 0;
 	}
 }
-	
+
 /*
  *	Some of this is a bit hackish. We intercept RIF information
  *	used for source routing. We also grab IP directly and don't feed
  *	it via SNAP.
  */
- 
+
 __be16 tr_type_trans(struct sk_buff *skb, struct net_device *dev)
 {
 
 	struct trh_hdr *trh=(struct trh_hdr *)skb->data;
 	struct trllc *trllc;
 	unsigned riflen=0;
-	
+
 	skb->mac.raw = skb->data;
-	
-       	if(trh->saddr[0] & TR_RII)
+
+	if(trh->saddr[0] & TR_RII)
 		riflen = (ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8;
 
 	trllc = (struct trllc *)(skb->data+sizeof(struct trh_hdr)-TR_MAXRIFLEN+riflen);
 
 	skb_pull(skb,sizeof(struct trh_hdr)-TR_MAXRIFLEN+riflen);
 
-	if(*trh->daddr & 0x80) 
+	if(*trh->daddr & 0x80)
 	{
-		if(!memcmp(trh->daddr,dev->broadcast,TR_ALEN)) 	
+		if(!memcmp(trh->daddr,dev->broadcast,TR_ALEN))
 			skb->pkt_type=PACKET_BROADCAST;
 		else
 			skb->pkt_type=PACKET_MULTICAST;
@@ -213,7 +213,7 @@
 	{
 		skb->pkt_type=PACKET_MULTICAST;
 	}
-	else if(dev->flags & IFF_PROMISC) 
+	else if(dev->flags & IFF_PROMISC)
 	{
 		if(memcmp(trh->daddr, dev->dev_addr, TR_ALEN))
 			skb->pkt_type=PACKET_OTHERHOST;
@@ -221,10 +221,10 @@
 
 	if ((skb->pkt_type != PACKET_BROADCAST) &&
 	    (skb->pkt_type != PACKET_MULTICAST))
-		tr_add_rif_info(trh,dev) ; 
+		tr_add_rif_info(trh,dev) ;
 
 	/*
-	 * Strip the SNAP header from ARP packets since we don't 
+	 * Strip the SNAP header from ARP packets since we don't
 	 * pass them through to the 802.2/SNAP layers.
 	 */
 
@@ -241,32 +241,32 @@
 }
 
 /*
- *	We try to do source routing... 
+ *	We try to do source routing...
  */
 
-void tr_source_route(struct sk_buff *skb,struct trh_hdr *trh,struct net_device *dev) 
+void tr_source_route(struct sk_buff *skb,struct trh_hdr *trh,struct net_device *dev)
 {
 	int slack;
 	unsigned int hash;
 	struct rif_cache *entry;
 	unsigned char *olddata;
 	unsigned long flags;
-	static const unsigned char mcast_func_addr[] 
+	static const unsigned char mcast_func_addr[]
 		= {0xC0,0x00,0x00,0x04,0x00,0x00};
-	
+
 	spin_lock_irqsave(&rif_lock, flags);
 
 	/*
-	 *	Broadcasts are single route as stated in RFC 1042 
+	 *	Broadcasts are single route as stated in RFC 1042
 	 */
 	if( (!memcmp(&(trh->daddr[0]),&(dev->broadcast[0]),TR_ALEN)) ||
 	    (!memcmp(&(trh->daddr[0]),&(mcast_func_addr[0]), TR_ALEN))  )
 	{
-		trh->rcf=htons((((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK)  
+		trh->rcf=htons((((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK)
 			       | TR_RCF_FRAME2K | TR_RCF_LIMITED_BROADCAST);
 		trh->saddr[0]|=TR_RII;
 	}
-	else 
+	else
 	{
 		hash = rif_hash(trh->daddr);
 		/*
@@ -277,7 +277,7 @@
 		/*
 		 *	If we found an entry we can route the frame.
 		 */
-		if(entry) 
+		if(entry)
 		{
 #if TR_SR_DEBUG
 printk("source routing for %02X:%02X:%02X:%02X:%02X:%02X\n",trh->daddr[0],
@@ -287,7 +287,7 @@
 			{
 				trh->rcf=entry->rcf;
 				memcpy(&trh->rseg[0],&entry->rseg[0],8*sizeof(unsigned short));
-				trh->rcf^=htons(TR_RCF_DIR_BIT);	
+				trh->rcf^=htons(TR_RCF_DIR_BIT);
 				trh->rcf&=htons(0x1fff);	/* Issam Chehab <ichehab@madge1.demon.co.uk> */
 
 				trh->saddr[0]|=TR_RII;
@@ -301,14 +301,14 @@
 			}
 			entry->last_used=jiffies;
 		}
-		else 
+		else
 		{
 			/*
 			 *	Without the information we simply have to shout
 			 *	on the wire. The replies should rapidly clean this
 			 *	situation up.
 			 */
-			trh->rcf=htons((((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK)  
+			trh->rcf=htons((((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK)
 				       | TR_RCF_FRAME2K | TR_RCF_LIMITED_BROADCAST);
 			trh->saddr[0]|=TR_RII;
 #if TR_SR_DEBUG
@@ -320,7 +320,7 @@
 	/* Compress the RIF here so we don't have to do it in the driver(s) */
 	if (!(trh->saddr[0] & 0x80))
 		slack = 18;
-	else 
+	else
 		slack = 18 - ((ntohs(trh->rcf) & TR_RCF_LEN_MASK)>>8);
 	olddata = skb->data;
 	spin_unlock_irqrestore(&rif_lock, flags);
@@ -333,7 +333,7 @@
  *	We have learned some new RIF information for our source
  *	routing.
  */
- 
+
 static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev)
 {
 	unsigned int hash, rii_p = 0;
@@ -343,29 +343,29 @@
 
 	spin_lock_irqsave(&rif_lock, flags);
 	saddr0 = trh->saddr[0];
-	
+
 	/*
 	 *	Firstly see if the entry exists
 	 */
 
-       	if(trh->saddr[0] & TR_RII)
+	if(trh->saddr[0] & TR_RII)
 	{
 		trh->saddr[0]&=0x7f;
 		if (((ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8) > 2)
 		{
 			rii_p = 1;
-	        }
+		}
 	}
 
 	hash = rif_hash(trh->saddr);
 	for(entry=rif_table[hash];entry && memcmp(&(entry->addr[0]),&(trh->saddr[0]),TR_ALEN);entry=entry->next);
 
-	if(entry==NULL) 
+	if(entry==NULL)
 	{
 #if TR_SR_DEBUG
 printk("adding rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n",
 		trh->saddr[0],trh->saddr[1],trh->saddr[2],
-       		trh->saddr[3],trh->saddr[4],trh->saddr[5],
+		trh->saddr[3],trh->saddr[4],trh->saddr[5],
 		ntohs(trh->rcf));
 #endif
 		/*
@@ -377,7 +377,7 @@
 		 */
 		entry=kmalloc(sizeof(struct rif_cache),GFP_ATOMIC);
 
-		if(!entry) 
+		if(!entry)
 		{
 			printk(KERN_DEBUG "tr.c: Couldn't malloc rif cache entry !\n");
 			spin_unlock_irqrestore(&rif_lock, flags);
@@ -400,13 +400,13 @@
 		{
 			entry->local_ring = 1;
 		}
-	} 	
+	}
 	else	/* Y. Tahara added */
-	{ 
+	{
 		/*
 		 *	Update existing entries
 		 */
-		if (!entry->local_ring) 
+		if (!entry->local_ring)
 		    if (entry->rcf != (trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK)) &&
 			 !(trh->rcf & htons(TR_RCF_BROADCAST_MASK)))
 		    {
@@ -417,9 +417,9 @@
 		ntohs(trh->rcf));
 #endif
 			    entry->rcf = trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK);
-        		    memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short));
-		    }                                         
-           	entry->last_used=jiffies;               
+			    memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short));
+		    }
+		entry->last_used=jiffies;
 	}
 	trh->saddr[0]=saddr0; /* put the routing indicator back for tcpdump */
 	spin_unlock_irqrestore(&rif_lock, flags);
@@ -429,16 +429,16 @@
  *	Scan the cache with a timer and see what we need to throw out.
  */
 
-static void rif_check_expire(unsigned long dummy) 
+static void rif_check_expire(unsigned long dummy)
 {
 	int i;
 	unsigned long flags, next_interval = jiffies + sysctl_tr_rif_timeout/2;
 
 	spin_lock_irqsave(&rif_lock, flags);
-	
+
 	for(i =0; i < RIF_TABLE_SIZE; i++) {
 		struct rif_cache *entry, **pentry;
-		
+
 		pentry = rif_table+i;
 		while((entry=*pentry) != NULL) {
 			unsigned long expires
@@ -455,7 +455,7 @@
 			}
 		}
 	}
-	
+
 	spin_unlock_irqrestore(&rif_lock, flags);
 
 	mod_timer(&rif_timer, next_interval);
@@ -466,7 +466,7 @@
  *	Generate the /proc/net information for the token ring RIF
  *	routing.
  */
- 
+
 #ifdef CONFIG_PROC_FS
 
 static struct rif_cache *rif_get_idx(loff_t pos)
@@ -475,7 +475,7 @@
 	struct rif_cache *entry;
 	loff_t off = 0;
 
-	for(i = 0; i < RIF_TABLE_SIZE; i++) 
+	for(i = 0; i < RIF_TABLE_SIZE; i++)
 		for(entry = rif_table[i]; entry; entry = entry->next) {
 			if (off == pos)
 				return entry;
@@ -504,7 +504,7 @@
 		goto scan;
 	}
 
-	if (ent->next) 
+	if (ent->next)
 		return ent->next;
 
 	i = rif_hash(ent->addr);
@@ -541,13 +541,13 @@
 			   ttl/HZ);
 
 			if (entry->local_ring)
-			        seq_puts(seq, "local\n");
+				seq_puts(seq, "local\n");
 			else {
 
 				seq_printf(seq, "%04X", ntohs(entry->rcf));
-				rcf_len = ((ntohs(entry->rcf) & TR_RCF_LEN_MASK)>>8)-2; 
+				rcf_len = ((ntohs(entry->rcf) & TR_RCF_LEN_MASK)>>8)-2;
 				if (rcf_len)
-				        rcf_len >>= 1;
+					rcf_len >>= 1;
 				for(j = 1; j < rcf_len; j++) {
 					if(j==1) {
 						segment=ntohs(entry->rseg[j-1])>>4;
@@ -559,7 +559,7 @@
 				}
 				seq_putc(seq, '\n');
 			}
-	   	}
+		}
 	return 0;
 }
 
@@ -591,7 +591,7 @@
 	/*
 	 *	Configure and register
 	 */
-	
+
 	dev->hard_header	= tr_header;
 	dev->rebuild_header	= tr_rebuild_header;
 
@@ -600,7 +600,7 @@
 	dev->mtu		= 2000;
 	dev->addr_len		= TR_ALEN;
 	dev->tx_queue_len	= 100;	/* Long queues on tr */
-	
+
 	memset(dev->broadcast,0xFF, TR_ALEN);
 
 	/* New-style flags. */
