[PATCH] Fix the cpumask rewrite

From: James Bottomley
Date: Sat Jun 26 2004 - 11:10:16 EST


This patch:

ChangeSet 1.1828.1.25 2004/06/24 08:51:00 akpm@xxxxxxxx
[PATCH] cpumask: rewrite cpumask.h - single bitmap based implementation

From: Paul Jackson <pj@xxxxxxx>

Major rewrite of cpumask to use a single implementation, as a struct-wrapped
bitmap.

Altered the cpumask iterators to add a volatile to the bitmap type.
This might be correct for x86 and itanium, but it isn't for parisc where
our bitmap operators don't take volatile pointers. This makes our
compile incredibly noisy in just about every file:

CC mm/rmap.o
In file included from include/linux/sched.h:15,
from include/linux/mm.h:4,
from mm/rmap.c:29:
include/linux/cpumask.h: In function `__cpu_set':
include/linux/cpumask.h:86: warning: passing arg 2 of `set_bit' discards
qualifiers from pointer target type
include/linux/cpumask.h: In function `__cpu_clear':
include/linux/cpumask.h:92: warning: passing arg 2 of `clear_bit'
discards qualifiers from pointer target type

Since whether the bitmap operators are volatile or not is within the
province of the architecture to decide, I think the correct fix is just
to drop the spurious volatiles from cpumask.h

James

===== include/linux/cpumask.h 1.15 vs edited =====
--- 1.15/include/linux/cpumask.h 2004-06-24 13:57:31 -05:00
+++ edited/include/linux/cpumask.h 2004-06-26 11:00:14 -05:00
@@ -81,13 +81,13 @@
extern cpumask_t _unused_cpumask_arg_;

#define cpu_set(cpu, dst) __cpu_set((cpu), &(dst))
-static inline void __cpu_set(int cpu, volatile cpumask_t *dstp)
+static inline void __cpu_set(int cpu, cpumask_t *dstp)
{
set_bit(cpu, dstp->bits);
}

#define cpu_clear(cpu, dst) __cpu_clear((cpu), &(dst))
-static inline void __cpu_clear(int cpu, volatile cpumask_t *dstp)
+static inline void __cpu_clear(int cpu, cpumask_t *dstp)
{
clear_bit(cpu, dstp->bits);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/