Commit 7cd8ebe7 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] Fix cpumask iterator over empty cpu set

Can't use _ffs() without first checking for zero, and if bits beyond
NR_CPUS set it'll give bogus results.  Use find_first_bit
parent 0eaa6e8a
......@@ -43,7 +43,7 @@
#define cpus_promote(map) ({ map; })
#define cpumask_of_cpu(cpu) ({ ((cpumask_t)1) << (cpu); })
#define first_cpu(map) __ffs(map)
#define first_cpu(map) find_first_bit(&(map), NR_CPUS)
#define next_cpu(cpu, map) find_next_bit(&(map), NR_CPUS, cpu + 1)
#endif /* __ASM_GENERIC_CPUMASK_ARITH_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment