[PATCH 1/8] test: move ARRAY_SIZE() to libcflat.h

Avi Kivity
2010-07-28T10:18:29Z

kvm/test/lib/libcflat.h | 2 ++
kvm/test/x86/vmexit.c | 2 --
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kvm/test/lib/libcflat.h b/kvm/test/lib/libcflat.h
index 1da4013..7274fed 100644
--- a/kvm/test/lib/libcflat.h
+++ b/kvm/test/lib/libcflat.h
@@ -39,4 +39,6 @@ extern int vsnprintf(char *buf, int size, const char *fmt, va_list va);

extern void puts(const char *s);

+#define ARRAY_SIZE(_a) (sizeof(_a)/sizeof((_a)[0]))
+
#endif
diff --git a/kvm/test/x86/vmexit.c b/kvm/test/x86/vmexit.c
index 731316b..707d5c6 100644
--- a/kvm/test/x86/vmexit.c
+++ b/kvm/test/x86/vmexit.c
@@ -167,8 +167,6 @@ static void do_test(struct test *test)
printf("%s %d\n", test->name, (int)((t2 - t1) / iterations));
}

-#define ARRAY_SIZE(_x) (sizeof(_x) / sizeof((_x)[0]))
-
static void enable_nx(void *junk)
{
wrmsr(MSR_EFER, rdmsr(MSR_EFER) | EFER_NX_MASK);
--
1.7.1