diff options
Diffstat (limited to 'init/main.c')
-rw-r--r-- | init/main.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/init/main.c b/init/main.c index 1c5f6dce1bd2..a92989e7836a 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -387,14 +387,19 @@ static void __init setup_per_cpu_areas(void) | |||
387 | /* Called by boot processor to activate the rest. */ | 387 | /* Called by boot processor to activate the rest. */ |
388 | static void __init smp_init(void) | 388 | static void __init smp_init(void) |
389 | { | 389 | { |
390 | unsigned int i; | 390 | unsigned int cpu; |
391 | unsigned highest = 0; | ||
392 | |||
393 | for_each_cpu_mask(cpu, cpu_possible_map) | ||
394 | highest = cpu; | ||
395 | nr_cpu_ids = highest + 1; | ||
391 | 396 | ||
392 | /* FIXME: This should be done in userspace --RR */ | 397 | /* FIXME: This should be done in userspace --RR */ |
393 | for_each_present_cpu(i) { | 398 | for_each_present_cpu(cpu) { |
394 | if (num_online_cpus() >= max_cpus) | 399 | if (num_online_cpus() >= max_cpus) |
395 | break; | 400 | break; |
396 | if (!cpu_online(i)) | 401 | if (!cpu_online(cpu)) |
397 | cpu_up(i); | 402 | cpu_up(cpu); |
398 | } | 403 | } |
399 | 404 | ||
400 | /* Any cleanup work */ | 405 | /* Any cleanup work */ |