summaryrefslogtreecommitdiffstats
path: root/arch/arc/include/asm/cmpxchg.h
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2019-06-10 19:52:53 +0200
committerMark Brown <broonie@kernel.org>2019-06-10 19:52:53 +0200
commit4343f61103cdb8ccd6f3d5dd7168f1176a1cee37 (patch)
tree3db0a2e099cf7feb0c2d60d2a4bf1bf10d5253db /arch/arc/include/asm/cmpxchg.h
parentspi: Use struct_size() helper (diff)
parentLinux 5.2-rc4 (diff)
downloadlinux-4343f61103cdb8ccd6f3d5dd7168f1176a1cee37.tar.xz
linux-4343f61103cdb8ccd6f3d5dd7168f1176a1cee37.zip
Merge tag 'v5.2-rc4' into spi-5.3
Linux 5.2-rc4
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 */