diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 329d9fe..20db308 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -177,7 +177,7 @@
 static void tun_net_init(struct net_device *dev)
 {
 	struct tun_struct *tun = netdev_priv(dev);
-   
+
 	switch (tun->flags & TUN_TYPE_MASK) {
 	case TUN_TUN_DEV:
 		/* Point-to-Point TUN Device */
@@ -186,7 +186,7 @@
 		dev->mtu = 1500;
 
 		/* Zero header length */
-		dev->type = ARPHRD_NONE; 
+		dev->type = ARPHRD_NONE;
 		dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
 		dev->tx_queue_len = TUN_READQ_SIZE;  /* We prefer our own queue length */
 		break;
@@ -206,7 +206,7 @@
 
 /* Poll */
 static unsigned int tun_chr_poll(struct file *file, poll_table * wait)
-{  
+{
 	struct tun_struct *tun = file->private_data;
 	unsigned int mask = POLLOUT | POLLWRNORM;
 
@@ -216,7 +216,7 @@
 	DBG(KERN_INFO "%s: tun_chr_poll\n", tun->dev->name);
 
 	poll_wait(file, &tun->read_wait, wait);
- 
+
 	if (!skb_queue_empty(&tun->readq))
 		mask |= POLLIN | POLLRDNORM;
 
@@ -240,7 +240,7 @@
 
 	if ((tun->flags & TUN_TYPE_MASK) == TUN_TAP_DEV)
 		align = NET_IP_ALIGN;
- 
+
 	if (!(skb = alloc_skb(len + align, GFP_KERNEL))) {
 		tun->stats.rx_dropped++;
 		return -ENOMEM;
@@ -267,29 +267,29 @@
 
 	if (tun->flags & TUN_NOCHECKSUM)
 		skb->ip_summed = CHECKSUM_UNNECESSARY;
- 
+
 	netif_rx_ni(skb);
 	tun->dev->last_rx = jiffies;
-   
+
 	tun->stats.rx_packets++;
 	tun->stats.rx_bytes += len;
 
 	return count;
-} 
+}
 
 static inline size_t iov_total(const struct iovec *iv, unsigned long count)
 {
 	unsigned long i;
 	size_t len;
 
-	for (i = 0, len = 0; i < count; i++) 
+	for (i = 0, len = 0; i < count; i++)
 		len += iv[i].iov_len;
 
 	return len;
 }
 
 /* Writev */
-static ssize_t tun_chr_writev(struct file * file, const struct iovec *iv, 
+static ssize_t tun_chr_writev(struct file * file, const struct iovec *iv,
 			      unsigned long count, loff_t *pos)
 {
 	struct tun_struct *tun = file->private_data;
@@ -303,7 +303,7 @@
 }
 
 /* Write */
-static ssize_t tun_chr_write(struct file * file, const char __user * buf, 
+static ssize_t tun_chr_write(struct file * file, const char __user * buf,
 			     size_t count, loff_t *pos)
 {
 	struct iovec iv = { (void __user *) buf, count };
@@ -326,11 +326,11 @@
 			/* Packet will be striped */
 			pi.flags |= TUN_PKT_STRIP;
 		}
- 
+
 		if (memcpy_toiovec(iv, (void *) &pi, sizeof(pi)))
 			return -EFAULT;
 		total += sizeof(pi);
-	}       
+	}
 
 	len = min_t(int, skb->len, len);
 
@@ -427,7 +427,7 @@
 }
 
 /* Read */
-static ssize_t tun_chr_read(struct file * file, char __user * buf, 
+static ssize_t tun_chr_read(struct file * file, char __user * buf,
 			    size_t count, loff_t *pos)
 {
 	struct iovec iv = { buf, count };
@@ -480,8 +480,8 @@
 		if (tun->owner != -1 &&
 		    current->euid != tun->owner && !capable(CAP_NET_ADMIN))
 			return -EPERM;
-	} 
-	else if (__dev_get_by_name(ifr->ifr_name)) 
+	}
+	else if (__dev_get_by_name(ifr->ifr_name))
 		return -EINVAL;
 	else {
 		char *name;
@@ -501,9 +501,9 @@
 			/* TAP device */
 			flags |= TUN_TAP_DEV;
 			name = "tap%d";
-		} else 
+		} else
 			goto failed;
-   
+
 		if (*ifr->ifr_name)
 			name = ifr->ifr_name;
 
@@ -533,7 +533,7 @@
 		err = register_netdevice(tun->dev);
 		if (err < 0)
 			goto err_free_dev;
-	
+
 		list_add(&tun->list, &tun_dev_list);
 	}
 
@@ -557,7 +557,7 @@
 	return err;
 }
 
-static int tun_chr_ioctl(struct inode *inode, struct file *file, 
+static int tun_chr_ioctl(struct inode *inode, struct file *file,
 			 unsigned int cmd, unsigned long arg)
 {
 	struct tun_struct *tun = file->private_data;
@@ -711,14 +711,14 @@
 	DBG(KERN_INFO "%s: tun_chr_fasync %d\n", tun->dev->name, on);
 
 	if ((ret = fasync_helper(fd, file, on, &tun->fasync)) < 0)
-		return ret; 
- 
+		return ret;
+
 	if (on) {
 		ret = f_setown(file, current->pid, 0);
 		if (ret)
 			return ret;
 		tun->flags |= TUN_FASYNC;
-	} else 
+	} else
 		tun->flags &= ~TUN_FASYNC;
 
 	return 0;
@@ -762,7 +762,7 @@
 }
 
 static struct file_operations tun_fops = {
-	.owner	= THIS_MODULE,	
+	.owner	= THIS_MODULE,
 	.llseek = no_llseek,
 	.read	= tun_chr_read,
 	.readv	= tun_chr_readv,
@@ -772,7 +772,7 @@
 	.ioctl	= tun_chr_ioctl,
 	.open	= tun_chr_open,
 	.release = tun_chr_close,
-	.fasync = tun_chr_fasync		
+	.fasync = tun_chr_fasync
 };
 
 static struct miscdevice tun_miscdev = {
@@ -883,7 +883,7 @@
 {
 	struct tun_struct *tun, *nxt;
 
-	misc_deregister(&tun_miscdev);  
+	misc_deregister(&tun_miscdev);
 
 	rtnl_lock();
 	list_for_each_entry_safe(tun, nxt, &tun_dev_list, list) {
@@ -891,7 +891,7 @@
 		unregister_netdevice(tun->dev);
 	}
 	rtnl_unlock();
-	
+
 }
 
 module_init(tun_init);
