Skip to contentSkip to conversation

x86/tsc: Use cpumask_next_wrap() in tsc_sync_check_timer_fn()

PATCH New Fushuai Wang 1 participant 1 message Aug 6, 2025 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/tsc: Use cpumask_next_wrap() in tsc_sync_check_timer_fn()

Replace the manual sequence of cpumask_next() and cpumask_first() with a single call to cpumask_next_wrap() in tsc_sync_check_timer_fn().

---
 arch/x86/kernel/tsc_sync.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/kernel/tsc_sync.c +1 -3
index ec3aa340d351..ef6ebf2bf7aa 100644
@@ -99,9 +99,7 @@ static void tsc_sync_check_timer_fn(struct timer_list *unused)
 	tsc_verify_tsc_adjust(false);
 
 	/* Run the check for all onlined CPUs in turn */
-	next_cpu = cpumask_next(raw_smp_processor_id(), cpu_online_mask);
-	if (next_cpu >= nr_cpu_ids)
-		next_cpu = cpumask_first(cpu_online_mask);
+	next_cpu = cpumask_next_wrap(raw_smp_processor_id(), cpu_online_mask);
 
 	tsc_sync_check_timer.expires += SYNC_CHECK_INTERVAL;
 	add_timer_on(&tsc_sync_check_timer, next_cpu);
Signature · 1 line
2.36.1