Skip to content

Commit a5fc1ab

Browse files
heicarsttorvalds
authored andcommitted
atomic: fix atomic_long_cmpxchg/xchg for 64 bit architectures
On a linux-next allyesconfig build: kernel/trace/ring_buffer.c:1726: warning: passing argument 1 of 'atomic_cmpxchg' from incompatible pointer type linux-next/arch/s390/include/asm/atomic.h:112: note: expected 'struct atomic_t *' but argument is of type 'struct atomic64_t *' atomic_long_cmpxchg and atomic_long_xchg are incorrectly defined for 64 bit architectures. They should be mapped to the atomic64_* variants. Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 9e040a3 commit a5fc1ab

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎include/asm-generic/atomic.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u)
132132
#define atomic_long_inc_not_zero(l) atomic64_inc_not_zero((atomic64_t *)(l))
133133

134134
#define atomic_long_cmpxchg(l, old, new) \
135-
(atomic_cmpxchg((atomic64_t *)(l), (old), (new)))
135+
(atomic64_cmpxchg((atomic64_t *)(l), (old), (new)))
136136
#define atomic_long_xchg(v, new) \
137-
(atomic_xchg((atomic64_t *)(l), (new)))
137+
(atomic64_xchg((atomic64_t *)(l), (new)))
138138

139139
#else /* BITS_PER_LONG == 64 */
140140

0 commit comments

Comments
 (0)