diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-30 17:06:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-31 23:38:45 -0400 |
commit | 31b102bb501bea50ebc10f4aecf9d788305b8b87 (patch) | |
tree | f89a272ba7cd7bd71fe6ffdbb966d30e66cd12de /net/tipc/socket.c | |
parent | 1556770a1a071435ba7e67c1bc809099dc1de849 (diff) |
net: tipc: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.
Cc: Jon Maloy <jon.maloy@ericsson.com>
Cc: Ying Xue <ying.xue@windriver.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Cc: tipc-discussion@lists.sourceforge.net
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r-- | net/tipc/socket.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index ea61c32f6b80..5d18c0caa92b 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -125,7 +125,7 @@ static void tipc_sock_destruct(struct sock *sk); | |||
125 | static int tipc_release(struct socket *sock); | 125 | static int tipc_release(struct socket *sock); |
126 | static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags, | 126 | static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags, |
127 | bool kern); | 127 | bool kern); |
128 | static void tipc_sk_timeout(unsigned long data); | 128 | static void tipc_sk_timeout(struct timer_list *t); |
129 | static int tipc_sk_publish(struct tipc_sock *tsk, uint scope, | 129 | static int tipc_sk_publish(struct tipc_sock *tsk, uint scope, |
130 | struct tipc_name_seq const *seq); | 130 | struct tipc_name_seq const *seq); |
131 | static int tipc_sk_withdraw(struct tipc_sock *tsk, uint scope, | 131 | static int tipc_sk_withdraw(struct tipc_sock *tsk, uint scope, |
@@ -464,7 +464,7 @@ static int tipc_sk_create(struct net *net, struct socket *sock, | |||
464 | NAMED_H_SIZE, 0); | 464 | NAMED_H_SIZE, 0); |
465 | 465 | ||
466 | msg_set_origport(msg, tsk->portid); | 466 | msg_set_origport(msg, tsk->portid); |
467 | setup_timer(&sk->sk_timer, tipc_sk_timeout, (unsigned long)tsk); | 467 | timer_setup(&sk->sk_timer, tipc_sk_timeout, 0); |
468 | sk->sk_shutdown = 0; | 468 | sk->sk_shutdown = 0; |
469 | sk->sk_backlog_rcv = tipc_sk_backlog_rcv; | 469 | sk->sk_backlog_rcv = tipc_sk_backlog_rcv; |
470 | sk->sk_rcvbuf = sysctl_tipc_rmem[1]; | 470 | sk->sk_rcvbuf = sysctl_tipc_rmem[1]; |
@@ -2530,14 +2530,14 @@ static int tipc_shutdown(struct socket *sock, int how) | |||
2530 | return res; | 2530 | return res; |
2531 | } | 2531 | } |
2532 | 2532 | ||
2533 | static void tipc_sk_timeout(unsigned long data) | 2533 | static void tipc_sk_timeout(struct timer_list *t) |
2534 | { | 2534 | { |
2535 | struct tipc_sock *tsk = (struct tipc_sock *)data; | 2535 | struct sock *sk = from_timer(sk, t, sk_timer); |
2536 | struct tipc_sock *tsk = tipc_sk(sk); | ||
2536 | u32 peer_port = tsk_peer_port(tsk); | 2537 | u32 peer_port = tsk_peer_port(tsk); |
2537 | u32 peer_node = tsk_peer_node(tsk); | 2538 | u32 peer_node = tsk_peer_node(tsk); |
2538 | u32 own_node = tsk_own_node(tsk); | 2539 | u32 own_node = tsk_own_node(tsk); |
2539 | u32 own_port = tsk->portid; | 2540 | u32 own_port = tsk->portid; |
2540 | struct sock *sk = &tsk->sk; | ||
2541 | struct net *net = sock_net(sk); | 2541 | struct net *net = sock_net(sk); |
2542 | struct sk_buff *skb = NULL; | 2542 | struct sk_buff *skb = NULL; |
2543 | 2543 | ||