Commit 944a1376 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller

tun: Turn tun_flow_init() into void fn

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: default avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 274038f8
...@@ -841,7 +841,7 @@ static const struct net_device_ops tap_netdev_ops = { ...@@ -841,7 +841,7 @@ static const struct net_device_ops tap_netdev_ops = {
#endif #endif
}; };
static int tun_flow_init(struct tun_struct *tun) static void tun_flow_init(struct tun_struct *tun)
{ {
int i; int i;
...@@ -852,8 +852,6 @@ static int tun_flow_init(struct tun_struct *tun) ...@@ -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); setup_timer(&tun->flow_gc_timer, tun_flow_cleanup, (unsigned long)tun);
mod_timer(&tun->flow_gc_timer, mod_timer(&tun->flow_gc_timer,
round_jiffies_up(jiffies + tun->ageing_time)); round_jiffies_up(jiffies + tun->ageing_time));
return 0;
} }
static void tun_flow_uninit(struct tun_struct *tun) static void tun_flow_uninit(struct tun_struct *tun)
...@@ -1662,10 +1660,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) ...@@ -1662,10 +1660,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
goto err_free_dev; goto err_free_dev;
tun_net_init(dev); tun_net_init(dev);
tun_flow_init(tun);
err = tun_flow_init(tun);
if (err < 0)
goto err_free_dev;
dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST |
TUN_USER_FEATURES; TUN_USER_FEATURES;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment