Skip to content

Commit 220beff

Browse files
Ingo MolnarKAGA-KOKO
authored andcommitted
timers: Rename NEXT_TIMER_MAX_DELTA as TIMER_NEXT_MAX_DELTA
Move this macro to the canonical TIMER_* namespace. Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/20250507175338.672442-7-mingo@kernel.org
1 parent 9a716ac commit 220beff

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

arch/powerpc/kvm/booke.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu *vcpu,
572572

573573
/*
574574
* Return the number of jiffies until the next timeout. If the timeout is
575-
* longer than the NEXT_TIMER_MAX_DELTA, then return NEXT_TIMER_MAX_DELTA
575+
* longer than the TIMER_NEXT_MAX_DELTA, then return TIMER_NEXT_MAX_DELTA
576576
* because the larger value can break the timer APIs.
577577
*/
578578
static unsigned long watchdog_next_timeout(struct kvm_vcpu *vcpu)
@@ -598,7 +598,7 @@ static unsigned long watchdog_next_timeout(struct kvm_vcpu *vcpu)
598598
if (do_div(nr_jiffies, tb_ticks_per_jiffy))
599599
nr_jiffies++;
600600

601-
return min_t(unsigned long long, nr_jiffies, NEXT_TIMER_MAX_DELTA);
601+
return min_t(unsigned long long, nr_jiffies, TIMER_NEXT_MAX_DELTA);
602602
}
603603

604604
static void arm_next_watchdog(struct kvm_vcpu *vcpu)
@@ -616,10 +616,10 @@ static void arm_next_watchdog(struct kvm_vcpu *vcpu)
616616
spin_lock_irqsave(&vcpu->arch.wdt_lock, flags);
617617
nr_jiffies = watchdog_next_timeout(vcpu);
618618
/*
619-
* If the number of jiffies of watchdog timer >= NEXT_TIMER_MAX_DELTA
619+
* If the number of jiffies of watchdog timer >= TIMER_NEXT_MAX_DELTA
620620
* then do not run the watchdog timer as this can break timer APIs.
621621
*/
622-
if (nr_jiffies < NEXT_TIMER_MAX_DELTA)
622+
if (nr_jiffies < TIMER_NEXT_MAX_DELTA)
623623
mod_timer(&vcpu->arch.wdt_timer, jiffies + nr_jiffies);
624624
else
625625
timer_delete(&vcpu->arch.wdt_timer);

include/linux/timer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ extern int timer_reduce(struct timer_list *timer, unsigned long expires);
156156
* The jiffies value which is added to now, when there is no timer
157157
* in the timer wheel:
158158
*/
159-
#define NEXT_TIMER_MAX_DELTA ((1UL << 30) - 1)
159+
#define TIMER_NEXT_MAX_DELTA ((1UL << 30) - 1)
160160

161161
extern void add_timer(struct timer_list *timer);
162162
extern void add_timer_local(struct timer_list *timer);

kernel/time/timer.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,7 +1900,7 @@ static void timer_recalc_next_expiry(struct timer_base *base)
19001900
unsigned long clk, next, adj;
19011901
unsigned lvl, offset = 0;
19021902

1903-
next = base->clk + NEXT_TIMER_MAX_DELTA;
1903+
next = base->clk + TIMER_NEXT_MAX_DELTA;
19041904
clk = base->clk;
19051905
for (lvl = 0; lvl < LVL_DEPTH; lvl++, offset += LVL_SIZE) {
19061906
int pos = next_pending_bucket(base, offset, clk & LVL_MASK);
@@ -1963,7 +1963,7 @@ static void timer_recalc_next_expiry(struct timer_base *base)
19631963

19641964
WRITE_ONCE(base->next_expiry, next);
19651965
base->next_expiry_recalc = false;
1966-
base->timers_pending = !(next == base->clk + NEXT_TIMER_MAX_DELTA);
1966+
base->timers_pending = !(next == base->clk + TIMER_NEXT_MAX_DELTA);
19671967
}
19681968

19691969
#ifdef CONFIG_NO_HZ_COMMON
@@ -2015,7 +2015,7 @@ static unsigned long next_timer_interrupt(struct timer_base *base,
20152015
* easy comparable to find out which base holds the first pending timer.
20162016
*/
20172017
if (!base->timers_pending)
2018-
WRITE_ONCE(base->next_expiry, basej + NEXT_TIMER_MAX_DELTA);
2018+
WRITE_ONCE(base->next_expiry, basej + TIMER_NEXT_MAX_DELTA);
20192019

20202020
return base->next_expiry;
20212021
}
@@ -2399,7 +2399,7 @@ static inline void __run_timers(struct timer_base *base)
23992399
* timer at this clk are that all matching timers have been
24002400
* dequeued or no timer has been queued since
24012401
* base::next_expiry was set to base::clk +
2402-
* NEXT_TIMER_MAX_DELTA.
2402+
* TIMER_NEXT_MAX_DELTA.
24032403
*/
24042404
WARN_ON_ONCE(!levels && !base->next_expiry_recalc
24052405
&& base->timers_pending);
@@ -2544,7 +2544,7 @@ int timers_prepare_cpu(unsigned int cpu)
25442544
for (b = 0; b < NR_BASES; b++) {
25452545
base = per_cpu_ptr(&timer_bases[b], cpu);
25462546
base->clk = jiffies;
2547-
base->next_expiry = base->clk + NEXT_TIMER_MAX_DELTA;
2547+
base->next_expiry = base->clk + TIMER_NEXT_MAX_DELTA;
25482548
base->next_expiry_recalc = false;
25492549
base->timers_pending = false;
25502550
base->is_idle = false;
@@ -2599,7 +2599,7 @@ static void __init init_timer_cpu(int cpu)
25992599
base->cpu = cpu;
26002600
raw_spin_lock_init(&base->lock);
26012601
base->clk = jiffies;
2602-
base->next_expiry = base->clk + NEXT_TIMER_MAX_DELTA;
2602+
base->next_expiry = base->clk + TIMER_NEXT_MAX_DELTA;
26032603
timer_base_init_expiry_lock(base);
26042604
}
26052605
}

0 commit comments

Comments
 (0)