Merge branch 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
[powerpc.git] / lib / cpumask.c
index ba2f854..bb4f76d 100644 (file)
@@ -14,3 +14,15 @@ 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);
+
+int __any_online_cpu(const cpumask_t *mask)
+{
+       int cpu;
+
+       for_each_cpu_mask(cpu, *mask) {
+               if (cpu_online(cpu))
+                       break;
+       }
+       return cpu;
+}
+EXPORT_SYMBOL(__any_online_cpu);