diff options
| author | Andrew Morton <akpm@osdl.org> | 2003-09-21 01:39:11 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-09-21 01:39:11 -0700 |
| commit | 0774b4db8da2aa40b6dd47188a10ccb371eb3ef5 (patch) | |
| tree | 07f08029582a800d4f4538e1a64c8020f67d5769 /include/asm-generic/cpumask_array.h | |
| parent | bce2229801c2433bbd26f6ff01418e4eec9f73b8 (diff) | |
[PATCH] any_online_cpu fix
From: William Lee Irwin III <wli@holomorphy.com>
any_online_cpu() is required to and with cpu_online_map before
attempting to find an online cpu somewhere in the map; this patch adds
that logic to the implementation(s) of any_online_cpu().
Diffstat (limited to 'include/asm-generic/cpumask_array.h')
| -rw-r--r-- | include/asm-generic/cpumask_array.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/asm-generic/cpumask_array.h b/include/asm-generic/cpumask_array.h index 991a04bf7062..60c955d823b7 100644 --- a/include/asm-generic/cpumask_array.h +++ b/include/asm-generic/cpumask_array.h @@ -36,7 +36,13 @@ cpu_set(cpu, __cpu_mask); \ __cpu_mask; \ }) -#define any_online_cpu(map) find_first_bit((map).mask, NR_CPUS) +#define any_online_cpu(map) \ +({ \ + cpumask_t __tmp__; \ + cpus_and(__tmp__, map, cpu_online_map); \ + find_first_bit(__tmp__.mask, NR_CPUS); \ +}) + /* * um, these need to be usable as static initializers |
