hugemmap20: Use macro for flag description
Signed-off-by: Petr Vorel <pvorel@suse.cz>
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap20.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap20.c
index 6bc367f..e6b6bda 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap20.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap20.c
@@ -14,6 +14,7 @@
#include "hugetlb.h"
#define MNTPOINT "hugetlbfs/"
+#define FLAGS_DESC(x) .flags = x, .flags_str = #x
static int fd = -1;
static unsigned long hpage_size;
@@ -22,10 +23,10 @@
int flags;
char *flags_str;
} tcases[] = {
- {MAP_PRIVATE, "MAP_PRIVATE"},
- {MAP_SHARED, "MAP_SHARED"},
- {MAP_PRIVATE | MAP_LOCKED, "MAP_PRIVATE | MAP_LOCKED"},
- {MAP_SHARED | MAP_LOCKED, "MAP_SHARED | MAP_LOCKED"},
+ { FLAGS_DESC(MAP_PRIVATE) },
+ { FLAGS_DESC(MAP_SHARED) },
+ { FLAGS_DESC(MAP_PRIVATE | MAP_LOCKED) },
+ { FLAGS_DESC(MAP_SHARED | MAP_LOCKED) },
};
static void run_test(unsigned int i)