summaryrefslogtreecommitdiff
path: root/arch/riscv/include/asm/string.h
diff options
context:
space:
mode:
authorRick Chen <rick@andestech.com>2018-02-12 11:07:58 +0800
committerAndes <uboot@andestech.com>2018-03-30 13:13:22 +0800
commitbc0818a6a94429f2abd070afaa489266e78bf86b (patch)
tree57c3ffdabe89dcabf8b95e8f711b43febebcb3d2 /arch/riscv/include/asm/string.h
parent81cf7c8d45935a295991fe2cd1df286f0f47511f (diff)
downloadu-boot-bc0818a6a94429f2abd070afaa489266e78bf86b.tar.gz
riscv: checkpatch: Fix Macro argument reuse
It is CHECK reported by checkpatch.pl CHECK: Macro argument reuse 'PTE' - possible side-effects? Signed-off-by: Rick Chen <rick@andestech.com> Signed-off-by: Rick Chen <rickchen36@gmail.com>
Diffstat (limited to 'arch/riscv/include/asm/string.h')
-rw-r--r--arch/riscv/include/asm/string.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/riscv/include/asm/string.h b/arch/riscv/include/asm/string.h
index 038cdaea72..0fc3424a2f 100644
--- a/arch/riscv/include/asm/string.h
+++ b/arch/riscv/include/asm/string.h
@@ -26,8 +26,11 @@
#undef __HAVE_ARCH_MEMSET
#ifdef CONFIG_MARCO_MEMSET
-#define memset(p, v, n) \
- ({ \
+#define memset(_p, _v, _n) \
+ (typeof(_p) (p) = (_p); \
+ typeof(_v) (v) = (_v); \
+ typeof(_n) (n) = (_n); \
+ { \
if ((n) != 0) { \
if (__builtin_constant_p((v)) && (v) == 0) \
__memzero((p), (n)); \
@@ -37,7 +40,10 @@
(p); \
})
-#define memzero(p, n) ({ if ((n) != 0) __memzero((p), (n)); (p); })
+#define memzero(_p, _n) \
+ (typeof(_p) (p) = (_p); \
+ typeof(_n) (n) = (_n); \
+ { if ((n) != 0) __memzero((p), (n)); (p); })
#endif
#endif /* __ASM_RISCV_STRING_H */