diff options
-rw-r--r-- | include/linux/cpumask.h | 11 | ||||
-rw-r--r-- | lib/cpumask.c | 5 |
2 files changed, 9 insertions, 7 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 9b702fd24a7..4b29e508a0b 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -215,16 +215,13 @@ static inline void __cpus_shift_left(cpumask_t *dstp, #ifdef CONFIG_SMP int __first_cpu(const cpumask_t *srcp); #define first_cpu(src) __first_cpu(&(src)) +int __next_cpu(int n, const cpumask_t *srcp); +#define next_cpu(n, src) __next_cpu((n), &(src)) #else -#define first_cpu(src) 0 +#define first_cpu(src) 0 +#define next_cpu(n, src) 1 #endif -#define next_cpu(n, src) __next_cpu((n), &(src), NR_CPUS) -static inline int __next_cpu(int n, const cpumask_t *srcp, int nbits) -{ - return min_t(int, nbits, find_next_bit(srcp->bits, nbits, n+1)); -} - #define cpumask_of_cpu(cpu) \ ({ \ typeof(_unused_cpumask_arg_) m; \ diff --git a/lib/cpumask.c b/lib/cpumask.c index 1560d97390d..ba2f8543052 100644 --- a/lib/cpumask.c +++ b/lib/cpumask.c @@ -9,3 +9,8 @@ int __first_cpu(const cpumask_t *srcp) } EXPORT_SYMBOL(__first_cpu); +int __next_cpu(int n, const cpumask_t *srcp) +{ + return min_t(int, NR_CPUS, find_next_bit(srcp->bits, NR_CPUS, n+1)); +} +EXPORT_SYMBOL(__next_cpu); |