Skip to content

Commit 71c1a51

Browse files
committed
arch/alpha: replace cpumask_weight with cpumask_empty where appropriate
common_shutdown_1() calls cpumask_weight() to check if any bit of a given cpumask is set. We can do it more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov <[email protected]>
1 parent 8f51558 commit 71c1a51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/alpha/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ common_shutdown_1(void *generic_ptr)
125125
/* Wait for the secondaries to halt. */
126126
set_cpu_present(boot_cpuid, false);
127127
set_cpu_possible(boot_cpuid, false);
128-
while (cpumask_weight(cpu_present_mask))
128+
while (!cpumask_empty(cpu_present_mask))
129129
barrier();
130130
#endif
131131

0 commit comments

Comments
 (0)