net/core: Convert sk_timer users 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 for all users of sk_timer.

Cc: "David S. Miller" <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Andrew Hendry <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: David Howells <[email protected]>
Cc: Julia Lawall <[email protected]>
Cc: linzhang <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
Kees Cook 2017-10-16 17:29:36 -07:00 • committed by David S. Miller
commit 99767f278c
6 changed files with 46 additions and 42 deletions

View file

@ -28,7 +28,7 @@
#include <linux/interrupt.h>
#include <net/rose.h>
static void rose_heartbeat_expiry(unsigned long);
static void rose_heartbeat_expiry(struct timer_list *t);
static void rose_timer_expiry(struct timer_list *);
static void rose_idletimer_expiry(struct timer_list *);
@ -36,7 +36,7 @@ void rose_start_heartbeat(struct sock *sk)
{
del_timer(&sk->sk_timer);
sk->sk_timer.function = &rose_heartbeat_expiry;
sk->sk_timer.function = (TIMER_FUNC_TYPE)rose_heartbeat_expiry;
sk->sk_timer.expires = jiffies + 5 * HZ;
add_timer(&sk->sk_timer);
@ -119,9 +119,9 @@ void rose_stop_idletimer(struct sock *sk)
del_timer(&rose_sk(sk)->idletimer);
}
static void rose_heartbeat_expiry(unsigned long param)
static void rose_heartbeat_expiry(struct timer_list *t)
{
struct sock *sk = (struct sock *)param;
struct sock *sk = from_timer(sk, t, sk_timer);
struct rose_sock *rose = rose_sk(sk);
bh_lock_sock(sk);