diff options
author | Mathieu Desnoyers <compudj@krystal.dyndns.org> | 2008-02-08 18:00:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-08 18:33:32 -0500 |
commit | 6784fd5931a58559673f500a333030ceaadb69bb (patch) | |
tree | 911673988500ab7c923b210220a462286741c485 /include/asm-frv/system.h | |
parent | b55fcb22d445a7460cbbc138ceae096d5617715a (diff) |
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 <bunk@kernel.org> for spotting this bug.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Adrian Bunk <bunk@kernel.org>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-frv/system.h')
-rw-r--r-- | include/asm-frv/system.h | 3 |
1 files changed, 2 insertions, 1 deletions
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 @@ | |||
14 | 14 | ||
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
17 | #include <linux/kernel.h> | ||
17 | 18 | ||
18 | struct thread_struct; | 19 | struct thread_struct; |
19 | 20 | ||
@@ -276,7 +277,7 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr, | |||
276 | { | 277 | { |
277 | switch (size) { | 278 | switch (size) { |
278 | case 4: | 279 | case 4: |
279 | return cmpxchg(ptr, old, new); | 280 | return cmpxchg((unsigned long *)ptr, old, new); |
280 | default: | 281 | default: |
281 | return __cmpxchg_local_generic(ptr, old, new, size); | 282 | return __cmpxchg_local_generic(ptr, old, new, size); |
282 | } | 283 | } |