Skip to content

Commit 3180506

Browse files
anna-marialxKAGA-KOKO
authored andcommitted
tick/sched: Cleanup confusing variables
tick_nohz_stop_tick() contains the expires (u64 variable) and tick (ktime_t) variable. In the beginning the value of expires is written to tick. Afterwards none of the variables is changed. They are only used for checks. Drop the not required variable tick and use always expires instead. 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/20231201092654.34614-3-anna-maria@linutronix.de
1 parent cb665db commit 3180506

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

kernel/time/tick-sched.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,6 @@ static void tick_nohz_stop_tick(struct tick_sched *ts, int cpu)
887887
struct clock_event_device *dev = __this_cpu_read(tick_cpu_device.evtdev);
888888
u64 basemono = ts->timer_expires_base;
889889
u64 expires = ts->timer_expires;
890-
ktime_t tick = expires;
891890

892891
/* Make sure we won't be trying to stop it twice in a row. */
893892
ts->timer_expires_base = 0;
@@ -910,7 +909,7 @@ static void tick_nohz_stop_tick(struct tick_sched *ts, int cpu)
910909
/* Skip reprogram of event if it's not changed */
911910
if (ts->tick_stopped && (expires == ts->next_tick)) {
912911
/* Sanity check: make sure clockevent is actually programmed */
913-
if (tick == KTIME_MAX || ts->next_tick == hrtimer_get_expires(&ts->sched_timer))
912+
if (expires == KTIME_MAX || ts->next_tick == hrtimer_get_expires(&ts->sched_timer))
914913
return;
915914

916915
WARN_ON_ONCE(1);
@@ -935,7 +934,7 @@ static void tick_nohz_stop_tick(struct tick_sched *ts, int cpu)
935934
trace_tick_stop(1, TICK_DEP_MASK_NONE);
936935
}
937936

938-
ts->next_tick = tick;
937+
ts->next_tick = expires;
939938

940939
/*
941940
* If the expiration time == KTIME_MAX, then we simply stop
@@ -950,11 +949,11 @@ static void tick_nohz_stop_tick(struct tick_sched *ts, int cpu)
950949
}
951950

952951
if (ts->nohz_mode == NOHZ_MODE_HIGHRES) {
953-
hrtimer_start(&ts->sched_timer, tick,
952+
hrtimer_start(&ts->sched_timer, expires,
954953
HRTIMER_MODE_ABS_PINNED_HARD);
955954
} else {
956-
hrtimer_set_expires(&ts->sched_timer, tick);
957-
tick_program_event(tick, 1);
955+
hrtimer_set_expires(&ts->sched_timer, expires);
956+
tick_program_event(expires, 1);
958957
}
959958
}
960959

0 commit comments

Comments
 (0)