Skip to content

Commit b5e6f59

Browse files
anna-marialxKAGA-KOKO
authored andcommitted
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
1 parent d124c33 commit b5e6f59

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
@@ -1800,8 +1800,10 @@ static int next_pending_bucket(struct timer_base *base, unsigned offset,
18001800
/*
18011801
* Search the first expiring timer in the various clock levels. Caller must
18021802
* hold base->lock.
1803+
*
1804+
* Store next expiry time in base->next_expiry.
18031805
*/
1804-
static unsigned long __next_timer_interrupt(struct timer_base *base)
1806+
static void next_expiry_recalc(struct timer_base *base)
18051807
{
18061808
unsigned long clk, next, adj;
18071809
unsigned lvl, offset = 0;
@@ -1867,10 +1869,9 @@ static unsigned long __next_timer_interrupt(struct timer_base *base)
18671869
clk += adj;
18681870
}
18691871

1872+
base->next_expiry = next;
18701873
base->next_expiry_recalc = false;
18711874
base->timers_pending = !(next == base->clk + NEXT_TIMER_MAX_DELTA);
1872-
1873-
return next;
18741875
}
18751876

18761877
#ifdef CONFIG_NO_HZ_COMMON
@@ -1930,7 +1931,7 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem)
19301931

19311932
raw_spin_lock(&base->lock);
19321933
if (base->next_expiry_recalc)
1933-
base->next_expiry = __next_timer_interrupt(base);
1934+
next_expiry_recalc(base);
19341935
nextevt = base->next_expiry;
19351936

19361937
/*
@@ -2021,7 +2022,7 @@ static inline void __run_timers(struct timer_base *base)
20212022
WARN_ON_ONCE(!levels && !base->next_expiry_recalc
20222023
&& base->timers_pending);
20232024
base->clk++;
2024-
base->next_expiry = __next_timer_interrupt(base);
2025+
next_expiry_recalc(base);
20252026

20262027
while (levels--)
20272028
expire_timers(base, heads + levels);

0 commit comments

Comments
 (0)