Skip to content

Commit 46d076a

Browse files
covanamKAGA-KOKO
authored andcommitted
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
1 parent f3bef7a commit 46d076a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/sched/idle.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,8 @@ void play_idle_precise(u64 duration_ns, u64 latency_ns)
399399
cpuidle_use_deepest_state(latency_ns);
400400

401401
it.done = 0;
402-
hrtimer_init_on_stack(&it.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
403-
it.timer.function = idle_inject_timer_fn;
402+
hrtimer_setup_on_stack(&it.timer, idle_inject_timer_fn, CLOCK_MONOTONIC,
403+
HRTIMER_MODE_REL_HARD);
404404
hrtimer_start(&it.timer, ns_to_ktime(duration_ns),
405405
HRTIMER_MODE_REL_PINNED_HARD);
406406

0 commit comments

Comments
 (0)