diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-16 19:02:25 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2017-10-19 15:06:04 -0400 |
commit | 0d6942348c71cc3246d166245e811841b7388587 (patch) | |
tree | 9c0c01a5045192023bbff8d8e3f3b4b607772ba2 | |
parent | 7d7363e403ce959941f80684cc5f33e747afff17 (diff) |
samples: 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.
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r-- | samples/connector/cn_test.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/samples/connector/cn_test.c b/samples/connector/cn_test.c index d12cc944b696..95cd06f4ec1e 100644 --- a/samples/connector/cn_test.c +++ b/samples/connector/cn_test.c | |||
@@ -125,12 +125,12 @@ static int cn_test_want_notify(void) | |||
125 | #endif | 125 | #endif |
126 | 126 | ||
127 | static u32 cn_test_timer_counter; | 127 | static u32 cn_test_timer_counter; |
128 | static void cn_test_timer_func(unsigned long __data) | 128 | static void cn_test_timer_func(struct timer_list *unused) |
129 | { | 129 | { |
130 | struct cn_msg *m; | 130 | struct cn_msg *m; |
131 | char data[32]; | 131 | char data[32]; |
132 | 132 | ||
133 | pr_debug("%s: timer fired with data %lu\n", __func__, __data); | 133 | pr_debug("%s: timer fired\n", __func__); |
134 | 134 | ||
135 | m = kzalloc(sizeof(*m) + sizeof(data), GFP_ATOMIC); | 135 | m = kzalloc(sizeof(*m) + sizeof(data), GFP_ATOMIC); |
136 | if (m) { | 136 | if (m) { |
@@ -168,7 +168,7 @@ static int cn_test_init(void) | |||
168 | goto err_out; | 168 | goto err_out; |
169 | } | 169 | } |
170 | 170 | ||
171 | setup_timer(&cn_test_timer, cn_test_timer_func, 0); | 171 | timer_setup(&cn_test_timer, cn_test_timer_func, 0); |
172 | mod_timer(&cn_test_timer, jiffies + msecs_to_jiffies(1000)); | 172 | mod_timer(&cn_test_timer, jiffies + msecs_to_jiffies(1000)); |
173 | 173 | ||
174 | pr_info("initialized with id={%u.%u}\n", | 174 | pr_info("initialized with id={%u.%u}\n", |