|
@@ -1042,7 +1042,7 @@ static int get_cpu_number(struct device_node *dn)
|
|
{
|
|
{
|
|
const __be32 *cell;
|
|
const __be32 *cell;
|
|
u64 hwid;
|
|
u64 hwid;
|
|
- int i;
|
|
|
|
|
|
+ int cpu;
|
|
|
|
|
|
cell = of_get_property(dn, "reg", NULL);
|
|
cell = of_get_property(dn, "reg", NULL);
|
|
if (!cell)
|
|
if (!cell)
|
|
@@ -1056,9 +1056,9 @@ static int get_cpu_number(struct device_node *dn)
|
|
if (hwid & ~MPIDR_HWID_BITMASK)
|
|
if (hwid & ~MPIDR_HWID_BITMASK)
|
|
return -1;
|
|
return -1;
|
|
|
|
|
|
- for (i = 0; i < num_possible_cpus(); i++)
|
|
|
|
- if (cpu_logical_map(i) == hwid)
|
|
|
|
- return i;
|
|
|
|
|
|
+ for_each_possible_cpu(cpu)
|
|
|
|
+ if (cpu_logical_map(cpu) == hwid)
|
|
|
|
+ return cpu;
|
|
|
|
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|