rename thread_info to stack
[powerpc.git] / lib / cpumask.c
index ea25a03..bb4f76d 100644 (file)
@@ -15,19 +15,14 @@ int __next_cpu(int n, const cpumask_t *srcp)
 }
 EXPORT_SYMBOL(__next_cpu);
 
-/*
- * Find the highest possible smp_processor_id()
- *
- * Note: if we're prepared to assume that cpu_possible_map never changes
- * (reasonable) then this function should cache its return value.
- */
-int highest_possible_processor_id(void)
+int __any_online_cpu(const cpumask_t *mask)
 {
-       unsigned int cpu;
-       unsigned highest = 0;
+       int cpu;
 
-       for_each_cpu_mask(cpu, cpu_possible_map)
-               highest = cpu;
-       return highest;
+       for_each_cpu_mask(cpu, *mask) {
+               if (cpu_online(cpu))
+                       break;
+       }
+       return cpu;
 }
-EXPORT_SYMBOL(highest_possible_processor_id);
+EXPORT_SYMBOL(__any_online_cpu);