|
@@ -470,13 +470,13 @@ static void __init cpu_init_thread_core_maps(int tpc)
|
|
|
*/
|
|
|
void __init smp_setup_cpu_maps(void)
|
|
|
{
|
|
|
- struct device_node *dn = NULL;
|
|
|
+ struct device_node *dn;
|
|
|
int cpu = 0;
|
|
|
int nthreads = 1;
|
|
|
|
|
|
DBG("smp_setup_cpu_maps()\n");
|
|
|
|
|
|
- while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < nr_cpu_ids) {
|
|
|
+ for_each_node_by_type(dn, "cpu") {
|
|
|
const __be32 *intserv;
|
|
|
__be32 cpu_be;
|
|
|
int j, len;
|
|
@@ -516,6 +516,11 @@ void __init smp_setup_cpu_maps(void)
|
|
|
set_cpu_possible(cpu, true);
|
|
|
cpu++;
|
|
|
}
|
|
|
+
|
|
|
+ if (cpu >= nr_cpu_ids) {
|
|
|
+ of_node_put(dn);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/* If no SMT supported, nthreads is forced to 1 */
|