aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/socket.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-30 17:06:45 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-31 23:38:45 -0400
commit31b102bb501bea50ebc10f4aecf9d788305b8b87 (patch)
treef89a272ba7cd7bd71fe6ffdbb966d30e66cd12de /net/tipc/socket.c
parent1556770a1a071435ba7e67c1bc809099dc1de849 (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.c10
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);
125static int tipc_release(struct socket *sock); 125static int tipc_release(struct socket *sock);
126static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags, 126static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags,
127 bool kern); 127 bool kern);
128static void tipc_sk_timeout(unsigned long data); 128static void tipc_sk_timeout(struct timer_list *t);
129static int tipc_sk_publish(struct tipc_sock *tsk, uint scope, 129static int tipc_sk_publish(struct tipc_sock *tsk, uint scope,
130 struct tipc_name_seq const *seq); 130 struct tipc_name_seq const *seq);
131static int tipc_sk_withdraw(struct tipc_sock *tsk, uint scope, 131static 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
2533static void tipc_sk_timeout(unsigned long data) 2533static 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