2.6.16.9 alpha compile error
Subsystems (2)
arch/alpha/kernel/setup.c: In function `register_cpus':arch/alpha/kernel/setup.c:486: warning: implicit declaration of function for_each_possible_cpu' arch/alpha/kernel/setup.c:486: error: syntax error before '{' token arch/alpha/kernel/setup.c:488: error: p' undeclared (first use in this function) arch/alpha/kernel/setup.c:488: error: (Each undeclared identifier is reported only once arch/alpha/kernel/setup.c:488: error: for each function it appears in.) arch/alpha/kernel/setup.c: At top level:arch/alpha/kernel/setup.c:492: error: syntax error before "return"
This q&d patch fixes it for me:
--
arch/alpha/kernel/setup.c +2 -1
@@ -483,7 +483,8 @@ register_cpus(void) {int i; -for_each_possible_cpu (i) { +for (i =0 ; i <NR_CPUS ; i++) +if (cpu_possible (i)) {struct cpu *p =kzalloc (sizeof (*p),GFP_KERNEL );if (!p)return -ENOMEM ;
--
Quoted 8 lines · Ernst Herzberg
arch/alpha/kernel/setup.c: In function `register_cpus':arch/alpha/kernel/setup.c:486: warning: implicit declaration of functionfor_each_possible_cpu' arch/alpha/kernel/setup.c:486: error: syntax error before '{' token arch/alpha/kernel/setup.c:488: error:p' undeclared (first use in this function)arch/alpha/kernel/setup.c:488: error: (Each undeclared identifier is reported only oncearch/alpha/kernel/setup.c:488: error: for each function it appears in.)arch/alpha/kernel/setup.c: At top level:arch/alpha/kernel/setup.c:492: error: syntax error before "return"
From: Andrew Morton <[email protected]>
Backport for_each_possible_cpu() into 2.6.16. Fixes the alpha build, and any future occurrences.
---
include/linux/cpumask.h | 1 + 1 files changed, 1 insertion(+)
include/linux/cpumask.h 2006-04-24 19:29:21.000000000 +0200 renamed from include/linux/cpumask.h 2006-04-24 19:28:56.000000000 +0200 +1 -0
@@ -408,6 +408,7 @@ }) #define for_each_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map) +#define for_each_possible_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map) #define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map) #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map)