[PATCH 4/5] cpuidle: Use cpumask_intersects_and where applicable
From: Shrikanth Hegde
Date: Wed Nov 11 2026 - 03:06:16 EST
cpumask_first_and_and returns, usually the first CPU in the intersection
of the three cpumasks. However, if the returned CPU is not used or
only to check it against nr_cpu_ids, that implies to check whether the
three cpumasks have a bit in common. I.e use cpumask_intersects_and.
cpumask_first_and_and uses ffs on (addr1[idx] & addr2[idx] & addr3[idx])
whereas cpumask_intersects_and checks only
(addr1[idx] & addr2[idx] & addr3[idx]).
So replace such an occurrence.
Signed-off-by: Shrikanth Hegde <sshegde@xxxxxxxxxxxxx>
---
drivers/cpuidle/coupled.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c
index fb91a9e0e3c2..40db5c86a466 100644
--- a/drivers/cpuidle/coupled.c
+++ b/drivers/cpuidle/coupled.c
@@ -439,8 +439,8 @@ static int cpuidle_coupled_clear_pokes(int cpu)
static bool cpuidle_coupled_any_pokes_pending(struct cpuidle_coupled *coupled)
{
- return cpumask_first_and_and(cpu_online_mask, &coupled->coupled_cpus,
- &cpuidle_coupled_poke_pending) < nr_cpu_ids;
+ return cpumask_intersects_and(cpu_online_mask, &coupled->coupled_cpus,
+ &cpuidle_coupled_poke_pending);
}
/**
--
2.52.0