summaryrefslogtreecommitdiff
path: root/arch/arc/include/asm/cmpxchg.h
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2019-08-16 16:40:08 +0200
committerStefan Agner <stefan.agner@toradex.com>2019-08-16 16:40:08 +0200
commit3758b8bd81966b63dc93093a323e9bdd734545fd (patch)
tree229bda2abe1a31d59da4b48e71aeefde934fe1d0 /arch/arc/include/asm/cmpxchg.h
parentd15d0b7a9f89cf5a905ad6802eb23100c8063939 (diff)
parentdd209b062b86dd951cf1da93f20aa497fe99d52d (diff)
Merge tag 'v4.19.59-rt24' into toradex_4.19.y-rttoradex_4.19.y-rt
Linux 4.19.59-rt24
Diffstat (limited to 'arch/arc/include/asm/cmpxchg.h')
-rw-r--r--arch/arc/include/asm/cmpxchg.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/arc/include/asm/cmpxchg.h b/arch/arc/include/asm/cmpxchg.h
index d819de1c5d10..3ea4112c8302 100644
--- a/arch/arc/include/asm/cmpxchg.h
+++ b/arch/arc/include/asm/cmpxchg.h
@@ -92,8 +92,11 @@ __cmpxchg(volatile void *ptr, unsigned long expected, unsigned long new)
#endif /* CONFIG_ARC_HAS_LLSC */
-#define cmpxchg(ptr, o, n) ((typeof(*(ptr)))__cmpxchg((ptr), \
- (unsigned long)(o), (unsigned long)(n)))
+#define cmpxchg(ptr, o, n) ({ \
+ (typeof(*(ptr)))__cmpxchg((ptr), \
+ (unsigned long)(o), \
+ (unsigned long)(n)); \
+})
/*
* atomic_cmpxchg is same as cmpxchg
@@ -198,8 +201,11 @@ static inline unsigned long __xchg(unsigned long val, volatile void *ptr,
return __xchg_bad_pointer();
}
-#define xchg(ptr, with) ((typeof(*(ptr)))__xchg((unsigned long)(with), (ptr), \
- sizeof(*(ptr))))
+#define xchg(ptr, with) ({ \
+ (typeof(*(ptr)))__xchg((unsigned long)(with), \
+ (ptr), \
+ sizeof(*(ptr))); \
+})
#endif /* CONFIG_ARC_PLAT_EZNPS */