]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - lib/cpumask.c
Merge tag 'usb-4.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
[linux.git] / lib / cpumask.c
index 35fe142ebb5e2fefe6803445804b7481a52dded3..beca6244671a4ea066569e817bdbd912507b25db 100644 (file)
@@ -33,10 +33,11 @@ EXPORT_SYMBOL(cpumask_next);
 int cpumask_next_and(int n, const struct cpumask *src1p,
                     const struct cpumask *src2p)
 {
-       while ((n = cpumask_next(n, src1p)) < nr_cpu_ids)
-               if (cpumask_test_cpu(n, src2p))
-                       break;
-       return n;
+       /* -1 is a legal arg here. */
+       if (n != -1)
+               cpumask_check(n);
+       return find_next_and_bit(cpumask_bits(src1p), cpumask_bits(src2p),
+               nr_cpumask_bits, n + 1);
 }
 EXPORT_SYMBOL(cpumask_next_and);