summaryrefslogtreecommitdiff
path: root/kernel/time/sched_clock.c
diff options
context:
space:
mode:
authorNam Cao <namcao@linutronix.de>2025-02-05 11:39:04 +0100
committerThomas Gleixner <tglx@linutronix.de>2025-02-18 10:32:33 +0100
commitf66b0acf394b8558f79c03336b579a47876a6940 (patch)
tree282767006a547e91b1395841b1d32ab6949c51be /kernel/time/sched_clock.c
parent9eeb54b47541d2ea51315af324e236bb6e6942ea (diff)
downloadlinux-next-f66b0acf394b8558f79c03336b579a47876a6940.tar.gz
linux-next-f66b0acf394b8558f79c03336b579a47876a6940.zip
time: Switch to hrtimer_setup()
hrtimer_setup() takes the callback function pointer as argument and initializes the timer completely. Replace hrtimer_init() and the open coded initialization of hrtimer::function with the new setup mechanism. Signed-off-by: Nam Cao <namcao@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/170bb691a0d59917c8268a98c80b607128fc9f7f.1738746821.git.namcao@linutronix.de
Diffstat (limited to 'kernel/time/sched_clock.c')
-rw-r--r--kernel/time/sched_clock.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c
index fcca4e72f1ef..cc15fe293719 100644
--- a/kernel/time/sched_clock.c
+++ b/kernel/time/sched_clock.c
@@ -263,8 +263,7 @@ void __init generic_sched_clock_init(void)
* Start the timer to keep sched_clock() properly updated and
* sets the initial epoch.
*/
- hrtimer_init(&sched_clock_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
- sched_clock_timer.function = sched_clock_poll;
+ hrtimer_setup(&sched_clock_timer, sched_clock_poll, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
hrtimer_start(&sched_clock_timer, cd.wrap_kt, HRTIMER_MODE_REL_HARD);
}