aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/asm-generic/cmpxchg.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/asm-generic/cmpxchg.h b/include/asm-generic/cmpxchg.h
index 3766ab34aa45..e5f9080e8e86 100644
--- a/include/asm-generic/cmpxchg.h
+++ b/include/asm-generic/cmpxchg.h
@@ -79,8 +79,10 @@ unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
79 } 79 }
80} 80}
81 81
82#define xchg(ptr, x) \ 82#define xchg(ptr, x) ({ \
83 ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) 83 ((__typeof__(*(ptr))) \
84 __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))); \
85})
84 86
85#endif /* xchg */ 87#endif /* xchg */
86 88
@@ -90,9 +92,10 @@ unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
90#include <asm-generic/cmpxchg-local.h> 92#include <asm-generic/cmpxchg-local.h>
91 93
92#ifndef cmpxchg_local 94#ifndef cmpxchg_local
93#define cmpxchg_local(ptr, o, n) \ 95#define cmpxchg_local(ptr, o, n) ({ \
94 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ 96 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
95 (unsigned long)(n), sizeof(*(ptr)))) 97 (unsigned long)(n), sizeof(*(ptr)))); \
98})
96#endif 99#endif
97 100
98#ifndef cmpxchg64_local 101#ifndef cmpxchg64_local