diff options
| author | Kees Cook <[email protected]> | 2017-10-24 08:46:09 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2017-10-25 03:59:19 +0000 |
| commit | 839a6094140ade97ccc548fcd63179506c5d7fe4 (patch) | |
| tree | e9b9d6ee85cdcabe72ef234230ae615ec80d84a4 /net/dccp/timer.c | |
| parent | net: ethernet/sfc: Convert timers to use timer_setup() (diff) | |
| download | kernel-839a6094140ade97ccc548fcd63179506c5d7fe4.tar.gz kernel-839a6094140ade97ccc548fcd63179506c5d7fe4.zip | |
net: dccp: 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. Adds a pointer back to the sock.
Cc: Gerrit Renker <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Soheil Hassas Yeganeh <[email protected]>
Cc: Hannes Frederic Sowa <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/dccp/timer.c')
| -rw-r--r-- | net/dccp/timer.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/dccp/timer.c b/net/dccp/timer.c index 1e35526bf436..b50a8732ff43 100644 --- a/net/dccp/timer.c +++ b/net/dccp/timer.c @@ -234,10 +234,13 @@ static void dccp_write_xmitlet(unsigned long data) bh_unlock_sock(sk); } -static void dccp_write_xmit_timer(unsigned long data) +static void dccp_write_xmit_timer(struct timer_list *t) { - dccp_write_xmitlet(data); - sock_put((struct sock *)data); + struct dccp_sock *dp = from_timer(dp, t, dccps_xmit_timer); + struct sock *sk = &dp->dccps_inet_connection.icsk_inet.sk; + + dccp_write_xmitlet((unsigned long)sk); + sock_put(sk); } void dccp_init_xmit_timers(struct sock *sk) @@ -245,8 +248,7 @@ void dccp_init_xmit_timers(struct sock *sk) struct dccp_sock *dp = dccp_sk(sk); tasklet_init(&dp->dccps_xmitlet, dccp_write_xmitlet, (unsigned long)sk); - setup_timer(&dp->dccps_xmit_timer, dccp_write_xmit_timer, - (unsigned long)sk); + timer_setup(&dp->dccps_xmit_timer, dccp_write_xmit_timer, 0); inet_csk_init_xmit_timers(sk, &dccp_write_timer, &dccp_delack_timer, &dccp_keepalive_timer); } |
