Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] uml: avoid "CONFIG_NR_CPUS undeclared" bogus error messages

Olaf Hering <olh@suse.de>

Olaf reported UML doesn't build for him with a clear analisys of what happened
- we're using NR_CPUS in files linked against glibc headers. Seems like it
defines CONFIG_SMP but not CONFIG_NR_CPUS, so we get CONFIG_NR_CPUS
undeclared.

The fix is to move the declaration away from that header file and move it in
asm-um headers, and to add that header where needed.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Paolo 'Blaisorblade' Giarrusso and committed by
Linus Torvalds
72e55257 42947cb9

+3 -2
-2
arch/um/include/kern_util.h
··· 31 31 extern int jail; 32 32 extern int nsyscalls; 33 33 34 - extern struct task_struct *idle_threads[NR_CPUS]; 35 - 36 34 #define UML_ROUND_DOWN(addr) ((void *)(((unsigned long) addr) & PAGE_MASK)) 37 35 #define UML_ROUND_UP(addr) \ 38 36 UML_ROUND_DOWN(((unsigned long) addr) + PAGE_SIZE - 1)
+1
arch/um/kernel/reboot.c
··· 5 5 6 6 #include "linux/module.h" 7 7 #include "linux/sched.h" 8 + #include "asm/smp.h" 8 9 #include "user_util.h" 9 10 #include "kern_util.h" 10 11 #include "kern.h"
+2
include/asm-um/smp.h
··· 23 23 { 24 24 } 25 25 26 + extern struct task_struct *idle_threads[NR_CPUS]; 27 + 26 28 #endif 27 29 28 30 #endif