[CRIU] [PATCH 1/2] zdtm: Add ARRAY_SIZE into the header

Cyrill Gorcunov gorcunov at openvz.org
Wed Dec 23 07:55:28 PST 2015


Suitable macro.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 test/zdtm/lib/zdtmtst.h           | 2 ++
 test/zdtm/live/static/netns-dev.c | 2 --
 test/zdtm/live/static/vdso01.c    | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/test/zdtm/lib/zdtmtst.h b/test/zdtm/lib/zdtmtst.h
index 152bec66d9dc..f58435fa55eb 100644
--- a/test/zdtm/lib/zdtmtst.h
+++ b/test/zdtm/lib/zdtmtst.h
@@ -76,6 +76,8 @@ extern void __push_opt(struct long_opt *opt);
 #define __param_check(name, p, type) \
 	static inline type *__check_##name(void) { return(p); }
 
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
 extern void parseargs(int, char **);
 extern int parse_opt_bool(char *param, void *arg);
 #define param_check_bool(name, p) __param_check(name, p, int)
diff --git a/test/zdtm/live/static/netns-dev.c b/test/zdtm/live/static/netns-dev.c
index 78070d650363..fa623aaee7d1 100644
--- a/test/zdtm/live/static/netns-dev.c
+++ b/test/zdtm/live/static/netns-dev.c
@@ -4,8 +4,6 @@
 
 #include "zdtmtst.h"
 
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-
 #define LO_CONF_DIR_PATH "/proc/sys/net/ipv4/conf/lo"
 #define DEF_CONF_DIR_PATH "/proc/sys/net/ipv4/conf/default"
 
diff --git a/test/zdtm/live/static/vdso01.c b/test/zdtm/live/static/vdso01.c
index 57d947cec722..8db396ed82d9 100644
--- a/test/zdtm/live/static/vdso01.c
+++ b/test/zdtm/live/static/vdso01.c
@@ -25,7 +25,6 @@ typedef time_t (__vdso_time_t)(time_t *t);
 
 #define TIME_DELTA_SEC		(3)
 
-#define ARRAY_SIZE(x)		(sizeof(x) / sizeof((x)[0]))
 #define BUILD_BUG_ON(condition)	((void)sizeof(char[1 - 2*!!(condition)]))
 
 #define VDSO_BAD_ADDR		(-1ul)
-- 
2.5.0



More information about the CRIU mailing list