summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMatthew Dobson <colpatch@us.ibm.com>2005-01-04 05:28:02 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-04 05:28:02 -0800
commit90b8f3acdf04b44c5e0e93488f43b897a9db312f (patch)
tree8366cb55e1fe224336950498bcaa3c85942cc001 /include/linux
parenta319278834bd1e9e7b14910ffe3ddf7485817941 (diff)
[PATCH] cpumask_t initializers
In the course of another patch I've been working on, I stumbled across some weirdness with some of the SD_*_INIT sched_domains initializers. A day or so of digging narrowed it down to the CPU_MASK_NONE initializer nested inside the sched_domain initializers. The errors I got were: kernel/sched.c:4812: error: initializer element is not constant kernel/sched.c:4812: error: (near initialization for `sched_domain_dummy') kernel/sched.c:4812: error: initializer element is not constant which was this line: static struct sched_domain sched_domain_dummy = SD_CPU_INIT; Janis Johnson, a GCC hacker, told me the following:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cpumask.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 1ff1e85f6e59..8ccf5487ca99 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -234,29 +234,29 @@ static inline int __next_cpu(int n, const cpumask_t *srcp, int nbits)
#if NR_CPUS <= BITS_PER_LONG
#define CPU_MASK_ALL \
-((cpumask_t) { { \
+(cpumask_t) { { \
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
-} })
+} }
#else
#define CPU_MASK_ALL \
-((cpumask_t) { { \
+(cpumask_t) { { \
[0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
-} })
+} }
#endif
#define CPU_MASK_NONE \
-((cpumask_t) { { \
+(cpumask_t) { { \
[0 ... BITS_TO_LONGS(NR_CPUS)-1] = 0UL \
-} })
+} }
#define CPU_MASK_CPU0 \
-((cpumask_t) { { \
+(cpumask_t) { { \
[0] = 1UL \
-} })
+} }
#define cpus_addr(src) ((src).bits)