diff options
author | Nam Cao <namcao@linutronix.de> | 2024-10-31 16:14:30 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2024-11-07 02:47:06 +0100 |
commit | 46d076af6d640774a7a8bd6ebf130c22913d3bdb (patch) | |
tree | e9d9b1b8cd9233638344ff2919cbdd49ce707e1a /kernel/sched | |
parent | f3bef7aaa6c807b78e8fc6929c3226d3038fe505 (diff) |
sched/idle: Switch to use hrtimer_setup_on_stack()
hrtimer_setup_on_stack() takes the callback function pointer as argument
and initializes the timer completely.
Replace hrtimer_init_on_stack() and the open coded initialization of
hrtimer::function with the new setup mechanism.
The conversion was done with Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/17f9421fed6061df4ad26a4cc91873d2c078cb0f.1730386209.git.namcao@linutronix.de
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/idle.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c index d2f096bb274c..631e42802925 100644 --- a/kernel/sched/idle.c +++ b/kernel/sched/idle.c @@ -399,8 +399,8 @@ void play_idle_precise(u64 duration_ns, u64 latency_ns) cpuidle_use_deepest_state(latency_ns); it.done = 0; - hrtimer_init_on_stack(&it.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); - it.timer.function = idle_inject_timer_fn; + hrtimer_setup_on_stack(&it.timer, idle_inject_timer_fn, CLOCK_MONOTONIC, + HRTIMER_MODE_REL_HARD); hrtimer_start(&it.timer, ns_to_ktime(duration_ns), HRTIMER_MODE_REL_PINNED_HARD); |