[tip: timers/cleanups] hrtimers: Switch to use __htimer_setup()

tip-bot2 for Nam Cao posted 1 patch 10 months, 1 week ago
There is a newer version of this series
kernel/time/hrtimer.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[tip: timers/cleanups] hrtimers: Switch to use __htimer_setup()
Posted by tip-bot2 for Nam Cao 10 months, 1 week ago
The following commit has been merged into the timers/cleanups branch of tip:

Commit-ID:     0e090a0a12d8c8e54c1056eab2dfa3d4558cf498
Gitweb:        https://git.kernel.org/tip/0e090a0a12d8c8e54c1056eab2dfa3d4558cf498
Author:        Nam Cao <namcao@linutronix.de>
AuthorDate:    Wed, 05 Feb 2025 11:55:11 +01:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Fri, 04 Apr 2025 19:46:06 +02:00

hrtimers: Switch to use __htimer_setup()

__hrtimer_init_sleeper() calls __hrtimer_init() and also setups the
callback function. But there is already __hrtimer_setup() which does both
actions.

Switch to use __hrtimer_setup() to simplify the code.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/d9a45a51b6a8aa0045310d63f73753bf6b33f385.1738746927.git.namcao@linutronix.de

---
 kernel/time/hrtimer.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index b7555ba..2d2835c 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -2061,8 +2061,7 @@ static void __hrtimer_init_sleeper(struct hrtimer_sleeper *sl,
 			mode |= HRTIMER_MODE_HARD;
 	}
 
-	__hrtimer_init(&sl->timer, clock_id, mode);
-	sl->timer.function = hrtimer_wakeup;
+	__hrtimer_setup(&sl->timer, hrtimer_wakeup, clock_id, mode);
 	sl->task = current;
 }