From 6784fd5931a58559673f500a333030ceaadb69bb Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 8 Feb 2008 15:00:45 -0800 Subject: Fix FRV cmpxchg_local Fix the FRV cmpxchg_local by breaking the following header dependency loop : linux/kernel.h -> linux/bitops.h -> asm-frv/bitops.h -> asm-frv/atomic.h -> asm-frv/system.h -> asm-generic/cmpxchg_local.h -> typecheck() defined in linux/kernel.h and linux/kernel.h -> linux/bitops.h -> asm-frv/bitops.h -> asm-frv/atomic.h -> asm-generic/cmpxchg_local.h -> typecheck() defined in linux/kernel.h In order to fix this : - Move the atomic_test_and_ *_mask inlines from asm-frv/atomic.h (why are they there at all anyway ? They are not touching atomic_t variables!) to asm-frv/bitops.h. Also fix a build issue with cmpxchg : it does not cast to (unsigned long *) like other architectures, to deal with it in the cmpxchg_local macro. FRV builds fine with this patch. Thanks to Adrian Bunk for spotting this bug. Signed-off-by: Mathieu Desnoyers Cc: Adrian Bunk Cc: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-frv/system.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/asm-frv/system.h') diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h index 59be5443a68f..b400cea81487 100644 --- a/include/asm-frv/system.h +++ b/include/asm-frv/system.h @@ -14,6 +14,7 @@ #include #include +#include struct thread_struct; @@ -276,7 +277,7 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr, { switch (size) { case 4: - return cmpxchg(ptr, old, new); + return cmpxchg((unsigned long *)ptr, old, new); default: return __cmpxchg_local_generic(ptr, old, new, size); } -- cgit v1.2.3