diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index f2abd88e0c254d..91dcfc5a8de347 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -1109,7 +1109,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) } if (cpu_to_chip_id(boot_cpuid) != -1) { - int idx = num_possible_cpus() / threads_per_core; + int idx = max((int)num_possible_cpus() / threads_per_core, 1); /* * All threads of a core will all belong to the same core,