Skip to contentSkip to conversation

thermal: intel: hfi: use cpumask_empty() in intel_hfi_offline()

PATCH New Yury Norov 1 participant 1 message Mar 14 Thermal

lore
Share & tools
lore

Yury Norov

author
#0 lore raw

PATCH 1/1 thermal: intel: hfi: use cpumask_empty() in intel_hfi_offline()

cpumask_empty() is more efficient as it may return earlier. Switch to using it.

---
 drivers/thermal/intel/intel_hfi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/intel/intel_hfi.c +1 -1
index 1a1a95b39405..8c4ae75231f8 100644
@@ -526,7 +526,7 @@ void intel_hfi_offline(unsigned int cpu)
 	mutex_lock(&hfi_instance_lock);
 	cpumask_clear_cpu(cpu, hfi_instance->cpus);
 
-	if (!cpumask_weight(hfi_instance->cpus))
+	if (cpumask_empty(hfi_instance->cpus))
 		hfi_disable();
 
 	mutex_unlock(&hfi_instance_lock);
Signature · 1 line
2.43.0