[PATCH] thermal: intel: hfi: use cpumask_empty() in intel_hfi_offline()

Yury Norov posted 1 patch 3 weeks, 2 days ago
drivers/thermal/intel/intel_hfi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] thermal: intel: hfi: use cpumask_empty() in intel_hfi_offline()
Posted by Yury Norov 3 weeks, 2 days ago
cpumask_empty() is more efficient as it may return earlier. Switch to
using it.

Signed-off-by: Yury Norov <ynorov@nvidia.com>
---
 drivers/thermal/intel/intel_hfi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/intel_hfi.c
index 1a1a95b39405..8c4ae75231f8 100644
--- a/drivers/thermal/intel/intel_hfi.c
+++ b/drivers/thermal/intel/intel_hfi.c
@@ -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);
-- 
2.43.0