From 8aaf1dda42576b0f8dffb004065baa806f4df9b6 Mon Sep 17 00:00:00 2001 From: Chris Metcalf Date: Mon, 16 May 2011 13:59:39 -0400 Subject: arch/tile: use better definitions of xchg() and cmpxchg() These definitions use a ({}) construct to avoid some cases where we were getting warnings about unused return values. We also promote the definition to the common , since it applies to both the 32- and 64-bit atomics. In addition, define __HAVE_ARCH_CMPXCHG for TILE-Gx since it has efficient direct atomic instructions. Signed-off-by: Chris Metcalf --- arch/tile/include/asm/atomic_32.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'arch/tile/include/asm/atomic_32.h') diff --git a/arch/tile/include/asm/atomic_32.h b/arch/tile/include/asm/atomic_32.h index ed359ae..92a8bee 100644 --- a/arch/tile/include/asm/atomic_32.h +++ b/arch/tile/include/asm/atomic_32.h @@ -110,16 +110,6 @@ static inline void atomic_set(atomic_t *v, int n) _atomic_xchg(v, n); } -#define xchg(ptr, x) ((typeof(*(ptr))) \ - ((sizeof(*(ptr)) == sizeof(atomic_t)) ? \ - atomic_xchg((atomic_t *)(ptr), (long)(x)) : \ - __xchg_called_with_bad_pointer())) - -#define cmpxchg(ptr, o, n) ((typeof(*(ptr))) \ - ((sizeof(*(ptr)) == sizeof(atomic_t)) ? \ - atomic_cmpxchg((atomic_t *)(ptr), (long)(o), (long)(n)) : \ - __cmpxchg_called_with_bad_pointer())) - /* A 64bit atomic type */ typedef struct { -- cgit v1.1