diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-22 22:15:40 -0400 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2017-11-21 18:57:13 -0500 |
commit | 354b46b1a0adda1dd5b7f0bc2a5604cca091be5f (patch) | |
tree | 337614b13dad20aa1c591c4392ca1302d322096a | |
parent | c1eba5bcb6430868427e0b9d1cd1205a07302f06 (diff) |
timer: Switch callback prototype to take struct timer_list * argument
Since all callbacks have been converted, we can switch the core
prototype to "struct timer_list *" now too.
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
-rw-r--r-- | include/linux/timer.h | 4 | ||||
-rw-r--r-- | kernel/time/timer.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/timer.h b/include/linux/timer.h index 20a6e7af5fd6..a6d04fb72c9e 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -17,7 +17,7 @@ struct timer_list { | |||
17 | */ | 17 | */ |
18 | struct hlist_node entry; | 18 | struct hlist_node entry; |
19 | unsigned long expires; | 19 | unsigned long expires; |
20 | void (*function)(unsigned long); | 20 | void (*function)(struct timer_list *); |
21 | u32 flags; | 21 | u32 flags; |
22 | 22 | ||
23 | #ifdef CONFIG_LOCKDEP | 23 | #ifdef CONFIG_LOCKDEP |
@@ -63,7 +63,7 @@ struct timer_list { | |||
63 | 63 | ||
64 | #define TIMER_TRACE_FLAGMASK (TIMER_MIGRATING | TIMER_DEFERRABLE | TIMER_PINNED | TIMER_IRQSAFE) | 64 | #define TIMER_TRACE_FLAGMASK (TIMER_MIGRATING | TIMER_DEFERRABLE | TIMER_PINNED | TIMER_IRQSAFE) |
65 | 65 | ||
66 | #define TIMER_DATA_TYPE unsigned long | 66 | #define TIMER_DATA_TYPE struct timer_list * |
67 | #define TIMER_FUNC_TYPE void (*)(TIMER_DATA_TYPE) | 67 | #define TIMER_FUNC_TYPE void (*)(TIMER_DATA_TYPE) |
68 | 68 | ||
69 | #define __TIMER_INITIALIZER(_function, _data, _flags) { \ | 69 | #define __TIMER_INITIALIZER(_function, _data, _flags) { \ |
diff --git a/kernel/time/timer.c b/kernel/time/timer.c index a07eb124332f..0f0d49a02d04 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c | |||
@@ -1284,7 +1284,7 @@ int del_timer_sync(struct timer_list *timer) | |||
1284 | EXPORT_SYMBOL(del_timer_sync); | 1284 | EXPORT_SYMBOL(del_timer_sync); |
1285 | #endif | 1285 | #endif |
1286 | 1286 | ||
1287 | static void call_timer_fn(struct timer_list *timer, void (*fn)(unsigned long)) | 1287 | static void call_timer_fn(struct timer_list *timer, void (*fn)(struct timer_list *)) |
1288 | { | 1288 | { |
1289 | int count = preempt_count(); | 1289 | int count = preempt_count(); |
1290 | 1290 | ||
@@ -1308,7 +1308,7 @@ static void call_timer_fn(struct timer_list *timer, void (*fn)(unsigned long)) | |||
1308 | lock_map_acquire(&lockdep_map); | 1308 | lock_map_acquire(&lockdep_map); |
1309 | 1309 | ||
1310 | trace_timer_expire_entry(timer); | 1310 | trace_timer_expire_entry(timer); |
1311 | fn((TIMER_DATA_TYPE)timer); | 1311 | fn(timer); |
1312 | trace_timer_expire_exit(timer); | 1312 | trace_timer_expire_exit(timer); |
1313 | 1313 | ||
1314 | lock_map_release(&lockdep_map); | 1314 | lock_map_release(&lockdep_map); |
@@ -1330,7 +1330,7 @@ static void expire_timers(struct timer_base *base, struct hlist_head *head) | |||
1330 | { | 1330 | { |
1331 | while (!hlist_empty(head)) { | 1331 | while (!hlist_empty(head)) { |
1332 | struct timer_list *timer; | 1332 | struct timer_list *timer; |
1333 | void (*fn)(unsigned long); | 1333 | void (*fn)(struct timer_list *); |
1334 | 1334 | ||
1335 | timer = hlist_entry(head->first, struct timer_list, entry); | 1335 | timer = hlist_entry(head->first, struct timer_list, entry); |
1336 | 1336 | ||