From 70edf64bc6b51102cd321a63d3470f0f3196c594 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Tue, 29 May 2012 08:28:38 +0200 Subject: [PATCH] --- yaml --- r: 309598 b: refs/heads/master c: 6b894a409e8c0fcbd0ea30f5b013e33b9c4b28a1 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/s390/include/asm/cmpxchg.h | 34 ++++++++++++++++++++------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 1b9304dad469..2057c5bbb4c3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0c44ca71f59447a5e602c45728829d1cb6a1b4b5 +refs/heads/master: 6b894a409e8c0fcbd0ea30f5b013e33b9c4b28a1 diff --git a/trunk/arch/s390/include/asm/cmpxchg.h b/trunk/arch/s390/include/asm/cmpxchg.h index ebd31481f1d2..13c8b2eb6983 100644 --- a/trunk/arch/s390/include/asm/cmpxchg.h +++ b/trunk/arch/s390/include/asm/cmpxchg.h @@ -160,9 +160,14 @@ static inline unsigned long __cmpxchg(void *ptr, unsigned long old, return old; } -#define cmpxchg(ptr, o, n) \ - ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \ - (unsigned long)(n), sizeof(*(ptr)))) +#define cmpxchg(ptr, o, n) \ +({ \ + __typeof__(*(ptr)) __ret; \ + __ret = (__typeof__(*(ptr))) \ + __cmpxchg((ptr), (unsigned long)(o), (unsigned long)(n), \ + sizeof(*(ptr))); \ + __ret; \ +}) #ifdef CONFIG_64BIT #define cmpxchg64(ptr, o, n) \ @@ -184,10 +189,16 @@ static inline unsigned long long __cmpxchg64(void *ptr, : "memory", "cc"); return rp_old.pair; } -#define cmpxchg64(ptr, o, n) \ - ((__typeof__(*(ptr)))__cmpxchg64((ptr), \ - (unsigned long long)(o), \ - (unsigned long long)(n))) + +#define cmpxchg64(ptr, o, n) \ +({ \ + __typeof__(*(ptr)) __ret; \ + __ret = (__typeof__(*(ptr))) \ + __cmpxchg64((ptr), \ + (unsigned long long)(o), \ + (unsigned long long)(n)); \ + __ret; \ +}) #endif /* CONFIG_64BIT */ #include @@ -216,8 +227,13 @@ static inline unsigned long __cmpxchg_local(void *ptr, * them available. */ #define cmpxchg_local(ptr, o, n) \ - ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \ - (unsigned long)(n), sizeof(*(ptr)))) +({ \ + __typeof__(*(ptr)) __ret; \ + __ret = (__typeof__(*(ptr))) \ + __cmpxchg_local((ptr), (unsigned long)(o), \ + (unsigned long)(n), sizeof(*(ptr))); \ + __ret; \ +}) #define cmpxchg64_local(ptr, o, n) cmpxchg64((ptr), (o), (n))