hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/kernel/time/tick-common.c
....@@ -31,7 +31,6 @@
3131 * Tick next event: keeps track of the tick time
3232 */
3333 ktime_t tick_next_period;
34
-ktime_t tick_period;
3534
3635 /*
3736 * tick_do_timer_cpu is a timer core internal variable which holds the CPU NR
....@@ -89,7 +88,7 @@
8988 write_seqcount_begin(&jiffies_seq);
9089
9190 /* Keep track of the next tick event */
92
- tick_next_period = ktime_add(tick_next_period, tick_period);
91
+ tick_next_period = ktime_add_ns(tick_next_period, TICK_NSEC);
9392
9493 do_timer(1);
9594 write_seqcount_end(&jiffies_seq);
....@@ -129,7 +128,7 @@
129128 * Setup the next period for devices, which do not have
130129 * periodic mode:
131130 */
132
- next = ktime_add(next, tick_period);
131
+ next = ktime_add_ns(next, TICK_NSEC);
133132
134133 if (!clockevents_program_event(dev, next, false))
135134 return;
....@@ -175,7 +174,7 @@
175174 for (;;) {
176175 if (!clockevents_program_event(dev, next, false))
177176 return;
178
- next = ktime_add(next, tick_period);
177
+ next = ktime_add_ns(next, TICK_NSEC);
179178 }
180179 }
181180 }
....@@ -220,9 +219,7 @@
220219 */
221220 if (tick_do_timer_cpu == TICK_DO_TIMER_BOOT) {
222221 tick_do_timer_cpu = cpu;
223
-
224222 tick_next_period = ktime_get();
225
- tick_period = NSEC_PER_SEC / HZ;
226223 #ifdef CONFIG_NO_HZ_FULL
227224 /*
228225 * The boot CPU may be nohz_full, in which case set