Skip to content

Commit

Permalink
[SPARC64]: Warn user if cpu is ignored.
Browse files Browse the repository at this point in the history
When NR_CPUS is smaller than the cpu probed, let the user
know that the cpu won't be used.

Suggested by Al Viro.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 16, 2007
1 parent 301feb6 commit 8a177c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion arch/sparc64/kernel/mdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,12 @@ void __devinit mdesc_fill_in_cpu_data(cpumask_t mask)
cpuid = *id;

#ifdef CONFIG_SMP
if (cpuid >= NR_CPUS)
if (cpuid >= NR_CPUS) {
printk(KERN_WARNING "Ignoring CPU %d which is "
">= NR_CPUS (%d)\n",
cpuid, NR_CPUS);
continue;
}
if (!cpu_isset(cpuid, mask))
continue;
#else
Expand Down
6 changes: 5 additions & 1 deletion arch/sparc64/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1583,8 +1583,12 @@ static void __init of_fill_in_cpu_data(void)
ncpus_probed++;

#ifdef CONFIG_SMP
if (cpuid >= NR_CPUS)
if (cpuid >= NR_CPUS) {
printk(KERN_WARNING "Ignoring CPU %d which is "
">= NR_CPUS (%d)\n",
cpuid, NR_CPUS);
continue;
}
#else
/* On uniprocessor we only want the values for the
* real physical cpu the kernel booted onto, however
Expand Down

0 comments on commit 8a177c4

Please sign in to comment.