aboutsummaryrefslogtreecommitdiffstats
path: root/lib/cpumask.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cpumask.c')
-rw-r--r--lib/cpumask.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/cpumask.c b/lib/cpumask.c
index 35fe142ebb5e..beca6244671a 100644
--- a/lib/cpumask.c
+++ b/lib/cpumask.c
@@ -33,10 +33,11 @@ EXPORT_SYMBOL(cpumask_next);
33int cpumask_next_and(int n, const struct cpumask *src1p, 33int cpumask_next_and(int n, const struct cpumask *src1p,
34 const struct cpumask *src2p) 34 const struct cpumask *src2p)
35{ 35{
36 while ((n = cpumask_next(n, src1p)) < nr_cpu_ids) 36 /* -1 is a legal arg here. */
37 if (cpumask_test_cpu(n, src2p)) 37 if (n != -1)
38 break; 38 cpumask_check(n);
39 return n; 39 return find_next_and_bit(cpumask_bits(src1p), cpumask_bits(src2p),
40 nr_cpumask_bits, n + 1);
40} 41}
41EXPORT_SYMBOL(cpumask_next_and); 42EXPORT_SYMBOL(cpumask_next_and);
42 43