From e403669ebf740531b20b7e3a70fb16de1c6a3683 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 29 Dec 2003 05:45:14 -0800 Subject: [PATCH] [PATCH] Fix for more than 256 CPUs From: Paul Jackson The patch is needed to build NR_CPUS > 256. Without this fix, you get compile errors: include/linux/cpumask.h: In function `next_online_cpu': include/linux/cpumask.h:56: structure has no member named `val' --- include/asm-generic/cpumask_const_value.h | 2 +- include/asm-i386/mach-default/mach_apic.h | 6 +++--- include/linux/cpumask.h | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/asm-generic/cpumask_const_value.h b/include/asm-generic/cpumask_const_value.h index 7a4caefa4066e..16ca16d286dc9 100644 --- a/include/asm-generic/cpumask_const_value.h +++ b/include/asm-generic/cpumask_const_value.h @@ -3,7 +3,7 @@ typedef const cpumask_t cpumask_const_t; -#define mk_cpumask_const(map) ((cpumask_const_t)(map)) +#define mk_cpumask_const(map) (map) #define cpu_isset_const(cpu, map) cpu_isset(cpu, map) #define cpus_and_const(dst,src1,src2) cpus_and(dst, src1, src2) #define cpus_or_const(dst,src1,src2) cpus_or(dst, src1, src2) diff --git a/include/asm-i386/mach-default/mach_apic.h b/include/asm-i386/mach-default/mach_apic.h index 8875f34285bde..1d427aadfa412 100644 --- a/include/asm-i386/mach-default/mach_apic.h +++ b/include/asm-i386/mach-default/mach_apic.h @@ -5,12 +5,12 @@ #define APIC_DFR_VALUE (APIC_DFR_FLAT) -static inline cpumask_t target_cpus(void) +static inline cpumask_const_t target_cpus(void) { #ifdef CONFIG_SMP - return cpu_online_map; + return mk_cpumask_const(cpu_online_map); #else - return cpumask_of_cpu(0); + return mk_cpumask_const(cpumask_of_cpu(0)); #endif } #define TARGET_CPUS (target_cpus()) diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index c43921ec27fe3..6c47954f77778 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -53,18 +53,18 @@ extern cpumask_t cpu_online_map; static inline int next_online_cpu(int cpu, cpumask_t map) { do - cpu = next_cpu_const(cpu, map); + cpu = next_cpu_const(cpu, mk_cpumask_const(map)); while (cpu < NR_CPUS && !cpu_online(cpu)); return cpu; } #define for_each_cpu(cpu, map) \ - for (cpu = first_cpu_const(map); \ + for (cpu = first_cpu_const(mk_cpumask_const(map)); \ cpu < NR_CPUS; \ - cpu = next_cpu_const(cpu,map)) + cpu = next_cpu_const(cpu,mk_cpumask_const(map))) #define for_each_online_cpu(cpu, map) \ - for (cpu = first_cpu_const(map); \ + for (cpu = first_cpu_const(mk_cpumask_const(map)); \ cpu < NR_CPUS; \ cpu = next_online_cpu(cpu,map)) -- 2.53.0