return (tmp);
 }
 
-#define xchg(ptr, x)                                                   \
-       ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
+#define xchg(ptr, x) ({                                                        \
+       ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr),          \
+                                   sizeof(*(ptr))));                   \
+})
 
 static __always_inline unsigned long
 __xchg_local(unsigned long x, volatile void *ptr, int size)
        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)))                           \
+                __cmpxchg((ptr), (unsigned long)(o),   \
+                          (unsigned long)(n),          \
+                          sizeof(*(ptr))));            \
+})
 
 #include <asm-generic/cmpxchg-local.h>