Replace the manual sequence of cpumask_next() and cpumask_first()
with a single call to cpumask_next_wrap() in tsc_sync_check_timer_fn().
Signed-off-by: Fushuai Wang <wangfushuai@baidu.com>
---
arch/x86/kernel/tsc_sync.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c
index ec3aa340d351..ef6ebf2bf7aa 100644
--- a/arch/x86/kernel/tsc_sync.c
+++ b/arch/x86/kernel/tsc_sync.c
@@ -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);
--
2.36.1