aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm/string.h')
-rw-r--r--include/asm-arm/string.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/include/asm-arm/string.h b/include/asm-arm/string.h
index 2a8ab162412f..e50c4a39b699 100644
--- a/include/asm-arm/string.h
+++ b/include/asm-arm/string.h
@@ -29,15 +29,22 @@ extern void __memzero(void *ptr, __kernel_size_t n);
29 29
30#define memset(p,v,n) \ 30#define memset(p,v,n) \
31 ({ \ 31 ({ \
32 if ((n) != 0) { \ 32 void *__p = (p); size_t __n = n; \
33 if ((__n) != 0) { \
33 if (__builtin_constant_p((v)) && (v) == 0) \ 34 if (__builtin_constant_p((v)) && (v) == 0) \
34 __memzero((p),(n)); \ 35 __memzero((__p),(__n)); \
35 else \ 36 else \
36 memset((p),(v),(n)); \ 37 memset((__p),(v),(__n)); \
37 } \ 38 } \
38 (p); \ 39 (__p); \
39 }) 40 })
40 41
41#define memzero(p,n) ({ if ((n) != 0) __memzero((p),(n)); (p); }) 42#define memzero(p,n) \
43 ({ \
44 void *__p = (p); size_t __n = n; \
45 if ((__n) != 0) \
46 __memzero((__p),(__n)); \
47 (__p); \
48 })
42 49
43#endif 50#endif