Skip to content
  • Mathieu Desnoyers's avatar
    Fix FRV cmpxchg_local · 6784fd59
    Mathieu Desnoyers authored
    
    
    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: default avatarMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
    Cc: Adrian Bunk <bunk@kernel.org>
    Cc: David Howells <dhowells@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    6784fd59