summaryrefslogtreecommitdiff
path: root/net/ipv4/inet_timewait_sock.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-10-18 12:40:40 +0100
committerDavid S. Miller <davem@davemloft.net>2017-10-18 12:40:40 +0100
commit2af55f460738c78e63596e320f6dbde0cd4cfb84 (patch)
tree149c0e1ec9e7711d559c76ea0e5d82893d92b168 /net/ipv4/inet_timewait_sock.c
parent1bbc728988f09e40c83585cf3322b1f6c1aa17b5 (diff)
parentff861c4d64f2df1c7eaabaf2ba8f2f8ebc4b28e3 (diff)
downloadlinux-2af55f460738c78e63596e320f6dbde0cd4cfb84.tar.gz
linux-2af55f460738c78e63596e320f6dbde0cd4cfb84.tar.xz
Merge branch 'networking-Convert-timers-to-use-timer_setup'
Kees Cook says: ==================== networking: Convert timers to use timer_setup() This is the current set of outstanding networking patches to perform conversions to the new timer interface (rebased to -next). This is not all expected conversions, but it contains everything needed in networking to eliminate init_timer(), and all the non-standard setup_*_timer() uses. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inet_timewait_sock.c')
-rw-r--r--net/ipv4/inet_timewait_sock.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c
index 5b039159e67a..a4bab81f1462 100644
--- a/net/ipv4/inet_timewait_sock.c
+++ b/net/ipv4/inet_timewait_sock.c
@@ -142,9 +142,9 @@ void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk,
}
EXPORT_SYMBOL_GPL(__inet_twsk_hashdance);
-static void tw_timer_handler(unsigned long data)
+static void tw_timer_handler(struct timer_list *t)
{
- struct inet_timewait_sock *tw = (struct inet_timewait_sock *)data;
+ struct inet_timewait_sock *tw = from_timer(tw, t, tw_timer);
if (tw->tw_kill)
__NET_INC_STATS(twsk_net(tw), LINUX_MIB_TIMEWAITKILLED);
@@ -188,8 +188,7 @@ struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk,
tw->tw_prot = sk->sk_prot_creator;
atomic64_set(&tw->tw_cookie, atomic64_read(&sk->sk_cookie));
twsk_net_set(tw, sock_net(sk));
- setup_pinned_timer(&tw->tw_timer, tw_timer_handler,
- (unsigned long)tw);
+ timer_setup(&tw->tw_timer, tw_timer_handler, TIMER_PINNED);
/*
* Because we use RCU lookups, we should not set tw_refcnt
* to a non null value before everything is setup for this