diff options
author | Milton Miller <miltonm@bga.com> | 2011-05-10 21:28:59 +0200 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-05-19 06:30:45 +0200 |
commit | ebc04215108c124cb4f519d687a8e27a0d16a4aa (patch) | |
tree | f06697bdb1108e11c6a0b7ca904fc9f0c39b49c9 /arch/powerpc | |
parent | powerpc: Call no-longer static setup_nr_cpu_ids instead of replicating it (diff) | |
download | linux-ebc04215108c124cb4f519d687a8e27a0d16a4aa.tar.xz linux-ebc04215108c124cb4f519d687a8e27a0d16a4aa.zip |
powerpc/mpic: Limit NR_CPUS loop to 32 bit
mpic_physmask was looping NR_CPUS times over a mask that was passed as
a u32. Since mpic is architecturaly limited to 32 physical cpus, clamp
the logical cpus to 32 when compiling (we could also clamp at runtime
to nr_cpu_ids).
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/sysdev/mpic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 824a94fc413b..a93da805435f 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c @@ -631,7 +631,7 @@ static inline u32 mpic_physmask(u32 cpumask) int i; u32 mask = 0; - for (i = 0; i < NR_CPUS; ++i, cpumask >>= 1) + for (i = 0; i < min(32, NR_CPUS); ++i, cpumask >>= 1) mask |= (cpumask & 1) << get_hard_smp_processor_id(i); return mask; } |