From: Yury Norov Date: Sun, 23 Jan 2022 18:38:34 +0000 (-0800) Subject: thermal: intel_powerclamp: don't use bitmap_weight() in end_power_clamp() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a11cda8e2f184e35e42bbb96a27272b3c5e801d2;p=linux.git thermal: intel_powerclamp: don't use bitmap_weight() in end_power_clamp() Don't call bitmap_weight() if the following code can get by without it. Signed-off-by: Yury Norov Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c index 14256421d98c2..c841ab37e7c6d 100644 --- a/drivers/thermal/intel/intel_powerclamp.c +++ b/drivers/thermal/intel/intel_powerclamp.c @@ -556,12 +556,9 @@ static void end_power_clamp(void) * stop faster. */ clamping = false; - if (bitmap_weight(cpu_clamping_mask, num_possible_cpus())) { - for_each_set_bit(i, cpu_clamping_mask, num_possible_cpus()) { - pr_debug("clamping worker for cpu %d alive, destroy\n", - i); - stop_power_clamp_worker(i); - } + for_each_set_bit(i, cpu_clamping_mask, num_possible_cpus()) { + pr_debug("clamping worker for cpu %d alive, destroy\n", i); + stop_power_clamp_worker(i); } }