Skip to contentSkip to conversation

arch_topology: Use cpumask_intersects where applicable

PATCH RESEND New Shrikanth Hegde 1 participant 1 message Nov 17

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 arch_topology: Use cpumask_intersects where applicable

Looping over one cpumask and checking if any bit is set in another cpumask is same as evaluating if two cpumasks intersects or not.

So use cpumask_intersects instead. It is probably faster too.

---
This is resend of the v1 series posted as independent patch.
https://lore.kernel.org/all/[email protected]/

 drivers/base/arch_topology.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/base/arch_topology.c +1 -8
index 8c5e47c28d9a..aba86e9c2516 100644
@@ -34,14 +34,7 @@ EXPORT_PER_CPU_SYMBOL_GPL(capacity_freq_ref);
 
 static bool supports_scale_freq_counters(const struct cpumask *cpus)
 {
-	int i;
-
-	for_each_cpu(i, cpus) {
-		if (cpumask_test_cpu(i, &scale_freq_counters_mask))
-			return true;
-	}
-
-	return false;
+	return cpumask_intersects(cpus, &scale_freq_counters_mask);
 }
 
 bool topology_scale_freq_invariant(void)
Signature · 1 line
2.52.0