From: Yury Norov [NVIDIA] Date: Mon, 23 Jun 2025 00:00:07 +0000 (-0400) Subject: smp: Use cpumask_any_but() in smp_call_function_many_cond() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=976e0e3103e463725e19a5493d02ce7b7b380663;p=thirdparty%2Fkernel%2Flinux.git smp: Use cpumask_any_but() in smp_call_function_many_cond() smp_call_function_many_cond() opencodes cpumask_any_but(). Signed-off-by: Yury Norov [NVIDIA] Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/20250623000010.10124-3-yury.norov@gmail.com --- diff --git a/kernel/smp.c b/kernel/smp.c index 7c8cfab0ce550..5871acf3cd45b 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -807,13 +807,8 @@ static void smp_call_function_many_cond(const struct cpumask *mask, run_local = true; /* Check if we need remote execution, i.e., any CPU excluding this one. */ - cpu = cpumask_first_and(mask, cpu_online_mask); - if (cpu == this_cpu) - cpu = cpumask_next_and(cpu, mask, cpu_online_mask); - if (cpu < nr_cpu_ids) + if (cpumask_any_and_but(mask, cpu_online_mask, this_cpu) < nr_cpu_ids) { run_remote = true; - - if (run_remote) { cfd = this_cpu_ptr(&cfd_data); cpumask_and(cfd->cpumask, mask, cpu_online_mask); __cpumask_clear_cpu(this_cpu, cfd->cpumask);