netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] tun: Turn tun_flow_init() into void fn
@ 2013-06-11 13:01 Pavel Emelyanov
  2013-06-12 22:09 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Emelyanov @ 2013-06-11 13:01 UTC (permalink / raw)
  To: David Miller, Linux Netdev List

This routine doesn't fail since 9fdc6bef (tuntap: dont use a private kmem_cache)
so it makes sense to compact the code a little bit.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>

---

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 89776c5..544021e 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -841,7 +841,7 @@ static const struct net_device_ops tap_netdev_ops = {
 #endif
 };
 
-static int tun_flow_init(struct tun_struct *tun)
+static void tun_flow_init(struct tun_struct *tun)
 {
 	int i;
 
@@ -852,8 +852,6 @@ static int tun_flow_init(struct tun_struct *tun)
 	setup_timer(&tun->flow_gc_timer, tun_flow_cleanup, (unsigned long)tun);
 	mod_timer(&tun->flow_gc_timer,
 		  round_jiffies_up(jiffies + tun->ageing_time));
-
-	return 0;
 }
 
 static void tun_flow_uninit(struct tun_struct *tun)
@@ -1659,10 +1657,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
 			goto err_free_dev;
 
 		tun_net_init(dev);
-
-		err = tun_flow_init(tun);
-		if (err < 0)
-			goto err_free_dev;
+		tun_flow_init(tun);
 
 		dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST |
 			TUN_USER_FEATURES;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] tun: Turn tun_flow_init() into void fn
  2013-06-11 13:01 [PATCH net-next] tun: Turn tun_flow_init() into void fn Pavel Emelyanov
@ 2013-06-12 22:09 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-06-12 22:09 UTC (permalink / raw)
  To: xemul; +Cc: netdev

From: Pavel Emelyanov <xemul@parallels.com>
Date: Tue, 11 Jun 2013 17:01:08 +0400

> This routine doesn't fail since 9fdc6bef (tuntap: dont use a private kmem_cache)
> so it makes sense to compact the code a little bit.
> 
> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-12 22:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-11 13:01 [PATCH net-next] tun: Turn tun_flow_init() into void fn Pavel Emelyanov
2013-06-12 22:09 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).