aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tun.c
diff options
context:
space:
mode:
authorVitaliy Gusev <vgusev@openvz.org>2009-12-25 07:17:43 +0000
committerDavid S. Miller <davem@davemloft.net>2009-12-26 20:24:44 -0800
commit80924e5f7dbe00d964b7249160c7ca25fa3cd889 (patch)
tree8c1973dc42042703f2b50db5203efb30e9cf4a8f /drivers/net/tun.c
parentucc_geth: Don't needlessly change MAC settings in adjust_link() (diff)
downloadlinux-dev-80924e5f7dbe00d964b7249160c7ca25fa3cd889.tar.xz
linux-dev-80924e5f7dbe00d964b7249160c7ca25fa3cd889.zip
tun: use tun_sk instead container_of
Using macro tun_sk is more clear and shorter. However tun.c has tun_sk, but doesn't use it. Signed-off-by: Vitaliy Gusev <vgusev@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r--drivers/net/tun.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 01e99f22210e..2834a01bae24 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -849,13 +849,13 @@ static void tun_sock_write_space(struct sock *sk)
if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
wake_up_interruptible_sync(sk->sk_sleep);
- tun = container_of(sk, struct tun_sock, sk)->tun;
+ tun = tun_sk(sk)->tun;
kill_fasync(&tun->fasync, SIGIO, POLL_OUT);
}
static void tun_sock_destruct(struct sock *sk)
{
- free_netdev(container_of(sk, struct tun_sock, sk)->tun->dev);
+ free_netdev(tun_sk(sk)->tun->dev);
}
static struct proto tun_proto = {
@@ -990,7 +990,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
sk->sk_write_space = tun_sock_write_space;
sk->sk_sndbuf = INT_MAX;
- container_of(sk, struct tun_sock, sk)->tun = tun;
+ tun_sk(sk)->tun = tun;
security_tun_dev_post_create(sk);