OSDN Git Service

Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / lib / cpumask.c
index 5f62708..5a70f61 100644 (file)
 int cpumask_next_and(int n, const struct cpumask *src1p,
                     const struct cpumask *src2p)
 {
-       struct cpumask tmp;
-
-       if (cpumask_and(&tmp, src1p, src2p))
-               return cpumask_next(n, &tmp);
-       return nr_cpu_ids;
+       while ((n = cpumask_next(n, src1p)) < nr_cpu_ids)
+               if (cpumask_test_cpu(n, src2p))
+                       break;
+       return n;
 }
 EXPORT_SYMBOL(cpumask_next_and);