timers: Split out get next timer interrupt
authorAnna-Maria Behnsen <anna-maria@linutronix.de>
Wed, 21 Feb 2024 09:05:30 +0000 (10:05 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 22 Feb 2024 16:52:30 +0000 (17:52 +0100)
Split out get_next_timer_interrupt() to be able to extend it and make it
reusable for other call sites.

No functional change.

Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20240221090548.36600-3-anna-maria@linutronix.de
kernel/time/timer.c

index 316ded68fa0640c8888fec70cbd8ba1378a887c6..9f0cdba4afe07dcb88c68e12ecb94f612eb9e34b 100644 (file)
@@ -1956,15 +1956,7 @@ static u64 cmp_next_hrtimer_event(u64 basem, u64 expires)
        return DIV_ROUND_UP_ULL(nextevt, TICK_NSEC) * TICK_NSEC;
 }
 
-/**
- * get_next_timer_interrupt - return the time (clock mono) of the next timer
- * @basej:     base time jiffies
- * @basem:     base time clock monotonic
- *
- * Returns the tick aligned clock monotonic time of the next pending
- * timer or KTIME_MAX if no timer is pending.
- */
-u64 get_next_timer_interrupt(unsigned long basej, u64 basem)
+static inline u64 __get_next_timer_interrupt(unsigned long basej, u64 basem)
 {
        struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]);
        unsigned long nextevt = basej + NEXT_TIMER_MAX_DELTA;
@@ -2023,6 +2015,19 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem)
        return cmp_next_hrtimer_event(basem, expires);
 }
 
+/**
+ * get_next_timer_interrupt() - return the time (clock mono) of the next timer
+ * @basej:     base time jiffies
+ * @basem:     base time clock monotonic
+ *
+ * Returns the tick aligned clock monotonic time of the next pending
+ * timer or KTIME_MAX if no timer is pending.
+ */
+u64 get_next_timer_interrupt(unsigned long basej, u64 basem)
+{
+       return __get_next_timer_interrupt(basej, basem);
+}
+
 /**
  * timer_clear_idle - Clear the idle state of the timer base
  *