diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-16 20:28:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-18 07:39:36 -0400 |
commit | 83a37b3292f4aca799b355179ad6fbdd78a08e10 (patch) | |
tree | 271eed94148ad2d327f999bd4270bc341684887e /net/lapb/lapb_timer.c | |
parent | eb4ddaf474285a4c6986f4a1c3205bdb0bed2da9 (diff) |
net/lapb: 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: "David S. Miller" <davem@davemloft.net>
Cc: Hans Liljestrand <ishkamiel@gmail.com>
Cc: "Reshetova, Elena" <elena.reshetova@intel.com>
Cc: linux-x25@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/lapb/lapb_timer.c')
-rw-r--r-- | net/lapb/lapb_timer.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/net/lapb/lapb_timer.c b/net/lapb/lapb_timer.c index 1a5535bc3b8d..8bb469cb3abe 100644 --- a/net/lapb/lapb_timer.c +++ b/net/lapb/lapb_timer.c | |||
@@ -35,15 +35,14 @@ | |||
35 | #include <linux/interrupt.h> | 35 | #include <linux/interrupt.h> |
36 | #include <net/lapb.h> | 36 | #include <net/lapb.h> |
37 | 37 | ||
38 | static void lapb_t1timer_expiry(unsigned long); | 38 | static void lapb_t1timer_expiry(struct timer_list *); |
39 | static void lapb_t2timer_expiry(unsigned long); | 39 | static void lapb_t2timer_expiry(struct timer_list *); |
40 | 40 | ||
41 | void lapb_start_t1timer(struct lapb_cb *lapb) | 41 | void lapb_start_t1timer(struct lapb_cb *lapb) |
42 | { | 42 | { |
43 | del_timer(&lapb->t1timer); | 43 | del_timer(&lapb->t1timer); |
44 | 44 | ||
45 | lapb->t1timer.data = (unsigned long)lapb; | 45 | lapb->t1timer.function = (TIMER_FUNC_TYPE)lapb_t1timer_expiry; |
46 | lapb->t1timer.function = &lapb_t1timer_expiry; | ||
47 | lapb->t1timer.expires = jiffies + lapb->t1; | 46 | lapb->t1timer.expires = jiffies + lapb->t1; |
48 | 47 | ||
49 | add_timer(&lapb->t1timer); | 48 | add_timer(&lapb->t1timer); |
@@ -53,8 +52,7 @@ void lapb_start_t2timer(struct lapb_cb *lapb) | |||
53 | { | 52 | { |
54 | del_timer(&lapb->t2timer); | 53 | del_timer(&lapb->t2timer); |
55 | 54 | ||
56 | lapb->t2timer.data = (unsigned long)lapb; | 55 | lapb->t2timer.function = (TIMER_FUNC_TYPE)lapb_t2timer_expiry; |
57 | lapb->t2timer.function = &lapb_t2timer_expiry; | ||
58 | lapb->t2timer.expires = jiffies + lapb->t2; | 56 | lapb->t2timer.expires = jiffies + lapb->t2; |
59 | 57 | ||
60 | add_timer(&lapb->t2timer); | 58 | add_timer(&lapb->t2timer); |
@@ -75,9 +73,9 @@ int lapb_t1timer_running(struct lapb_cb *lapb) | |||
75 | return timer_pending(&lapb->t1timer); | 73 | return timer_pending(&lapb->t1timer); |
76 | } | 74 | } |
77 | 75 | ||
78 | static void lapb_t2timer_expiry(unsigned long param) | 76 | static void lapb_t2timer_expiry(struct timer_list *t) |
79 | { | 77 | { |
80 | struct lapb_cb *lapb = (struct lapb_cb *)param; | 78 | struct lapb_cb *lapb = from_timer(lapb, t, t2timer); |
81 | 79 | ||
82 | if (lapb->condition & LAPB_ACK_PENDING_CONDITION) { | 80 | if (lapb->condition & LAPB_ACK_PENDING_CONDITION) { |
83 | lapb->condition &= ~LAPB_ACK_PENDING_CONDITION; | 81 | lapb->condition &= ~LAPB_ACK_PENDING_CONDITION; |
@@ -85,9 +83,9 @@ static void lapb_t2timer_expiry(unsigned long param) | |||
85 | } | 83 | } |
86 | } | 84 | } |
87 | 85 | ||
88 | static void lapb_t1timer_expiry(unsigned long param) | 86 | static void lapb_t1timer_expiry(struct timer_list *t) |
89 | { | 87 | { |
90 | struct lapb_cb *lapb = (struct lapb_cb *)param; | 88 | struct lapb_cb *lapb = from_timer(lapb, t, t1timer); |
91 | 89 | ||
92 | switch (lapb->state) { | 90 | switch (lapb->state) { |
93 | 91 | ||