Skip to content

Commit 6500c07

Browse files
committed
timers: Move store of next event into __next_timer_interrupt()
JIRA: https://issues.redhat.com/browse/RHEL-33787 commit b5e6f59 Author: Anna-Maria Behnsen <anna-maria@linutronix.de> Date: Fri Dec 1 10:26:29 2023 +0100 timers: Move store of next event into __next_timer_interrupt() Both call sites of __next_timer_interrupt() store the return value directly in base->next_expiry. Move the store into __next_timer_interrupt() and to make its purpose more clear, rename the function to next_expiry_recalc(). No functional change. Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> Link: https://lore.kernel.org/r/20231201092654.34614-8-anna-maria@linutronix.de Signed-off-by: Phil Auld <pauld@redhat.com>
1 parent d117d7f commit 6500c07

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

kernel/time/timer.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,8 +1747,10 @@ static int next_pending_bucket(struct timer_base *base, unsigned offset,
17471747
/*
17481748
* Search the first expiring timer in the various clock levels. Caller must
17491749
* hold base->lock.
1750+
*
1751+
* Store next expiry time in base->next_expiry.
17501752
*/
1751-
static unsigned long __next_timer_interrupt(struct timer_base *base)
1753+
static void next_expiry_recalc(struct timer_base *base)
17521754
{
17531755
unsigned long clk, next, adj;
17541756
unsigned lvl, offset = 0;
@@ -1814,10 +1816,9 @@ static unsigned long __next_timer_interrupt(struct timer_base *base)
18141816
clk += adj;
18151817
}
18161818

1819+
base->next_expiry = next;
18171820
base->next_expiry_recalc = false;
18181821
base->timers_pending = !(next == base->clk + NEXT_TIMER_MAX_DELTA);
1819-
1820-
return next;
18211822
}
18221823

18231824
#ifdef CONFIG_NO_HZ_COMMON
@@ -1877,7 +1878,7 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem)
18771878

18781879
raw_spin_lock(&base->lock);
18791880
if (base->next_expiry_recalc)
1880-
base->next_expiry = __next_timer_interrupt(base);
1881+
next_expiry_recalc(base);
18811882
nextevt = base->next_expiry;
18821883

18831884
/*
@@ -1968,7 +1969,7 @@ static inline void __run_timers(struct timer_base *base)
19681969
WARN_ON_ONCE(!levels && !base->next_expiry_recalc
19691970
&& base->timers_pending);
19701971
base->clk++;
1971-
base->next_expiry = __next_timer_interrupt(base);
1972+
next_expiry_recalc(base);
19721973

19731974
while (levels--)
19741975
expire_timers(base, heads + levels);

0 commit comments

Comments
 (0)