Commit b5e6f598 authored by Anna-Maria Behnsen's avatar Anna-Maria Behnsen Committed by Thomas Gleixner

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: default avatarAnna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarFrederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20231201092654.34614-8-anna-maria@linutronix.de
parent d124c339
...@@ -1800,8 +1800,10 @@ static int next_pending_bucket(struct timer_base *base, unsigned offset, ...@@ -1800,8 +1800,10 @@ static int next_pending_bucket(struct timer_base *base, unsigned offset,
/* /*
* Search the first expiring timer in the various clock levels. Caller must * Search the first expiring timer in the various clock levels. Caller must
* hold base->lock. * hold base->lock.
*
* Store next expiry time in base->next_expiry.
*/ */
static unsigned long __next_timer_interrupt(struct timer_base *base) static void next_expiry_recalc(struct timer_base *base)
{ {
unsigned long clk, next, adj; unsigned long clk, next, adj;
unsigned lvl, offset = 0; unsigned lvl, offset = 0;
...@@ -1867,10 +1869,9 @@ static unsigned long __next_timer_interrupt(struct timer_base *base) ...@@ -1867,10 +1869,9 @@ static unsigned long __next_timer_interrupt(struct timer_base *base)
clk += adj; clk += adj;
} }
base->next_expiry = next;
base->next_expiry_recalc = false; base->next_expiry_recalc = false;
base->timers_pending = !(next == base->clk + NEXT_TIMER_MAX_DELTA); base->timers_pending = !(next == base->clk + NEXT_TIMER_MAX_DELTA);
return next;
} }
#ifdef CONFIG_NO_HZ_COMMON #ifdef CONFIG_NO_HZ_COMMON
...@@ -1930,7 +1931,7 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem) ...@@ -1930,7 +1931,7 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem)
raw_spin_lock(&base->lock); raw_spin_lock(&base->lock);
if (base->next_expiry_recalc) if (base->next_expiry_recalc)
base->next_expiry = __next_timer_interrupt(base); next_expiry_recalc(base);
nextevt = base->next_expiry; nextevt = base->next_expiry;
/* /*
...@@ -2021,7 +2022,7 @@ static inline void __run_timers(struct timer_base *base) ...@@ -2021,7 +2022,7 @@ static inline void __run_timers(struct timer_base *base)
WARN_ON_ONCE(!levels && !base->next_expiry_recalc WARN_ON_ONCE(!levels && !base->next_expiry_recalc
&& base->timers_pending); && base->timers_pending);
base->clk++; base->clk++;
base->next_expiry = __next_timer_interrupt(base); next_expiry_recalc(base);
while (levels--) while (levels--)
expire_timers(base, heads + levels); expire_timers(base, heads + levels);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment