summaryrefslogtreecommitdiff
path: root/arch/openrisc
diff options
context:
space:
mode:
authorStafford Horne <shorne@gmail.com>2017-03-13 01:41:55 +0300
committerStafford Horne <shorne@gmail.com>2017-03-15 18:12:56 +0300
commit8af42949d1681379c1a97d230de9242c1f4f326a (patch)
tree9ff0383d923e30c90200e150641a06a19a3e86bb /arch/openrisc
parent4495c08e84729385774601b5146d51d9e5849f81 (diff)
downloadlinux-8af42949d1681379c1a97d230de9242c1f4f326a.tar.xz
openrisc: xchg: fix `computed is not used` warning
When building allmodconfig this warning shows. fs/ocfs2/file.c: In function 'ocfs2_file_write_iter': ./arch/openrisc/include/asm/cmpxchg.h:81:3: warning: value computed is not used [-Wunused-value] ((typeof(*(ptr)))__xchg((unsigned long)(with), (ptr), sizeof(*(ptr)))) ^ Applying the same patch logic that was done to the cmpxchg macro. Signed-off-by: Stafford Horne <shorne@gmail.com>
Diffstat (limited to 'arch/openrisc')
-rw-r--r--arch/openrisc/include/asm/cmpxchg.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/openrisc/include/asm/cmpxchg.h b/arch/openrisc/include/asm/cmpxchg.h
index 5fcb9ac72693..f0a5d8b844d6 100644
--- a/arch/openrisc/include/asm/cmpxchg.h
+++ b/arch/openrisc/include/asm/cmpxchg.h
@@ -77,7 +77,11 @@ static inline unsigned long __xchg(unsigned long val, volatile void *ptr,
return val;
}
-#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 /* __ASM_OPENRISC_CMPXCHG_H */