Skip to content

Commit

Permalink
tun: Turn tun_flow_init() into void fn
Browse files Browse the repository at this point in the history
This routine doesn't fail since 9fdc6be (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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Jun 12, 2013
1 parent 274038f commit 944a137
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
Expand Down Expand Up @@ -1662,10 +1660,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;
Expand Down

0 comments on commit 944a137

Please sign in to comment.