From 863c7d22efbe40e3109aa86036c5fce51ca2b015 Mon Sep 17 00:00:00 2001 From: Petr Vorel Date: Fri, 9 Aug 2024 11:27:58 +0200 Subject: [PATCH] pkey01: Simplify struct initialization Signed-off-by: Petr Vorel --- testcases/kernel/syscalls/pkeys/pkey01.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testcases/kernel/syscalls/pkeys/pkey01.c b/testcases/kernel/syscalls/pkeys/pkey01.c index 6296b5ddd96..e5db2c253cc 100644 --- a/testcases/kernel/syscalls/pkeys/pkey01.c +++ b/testcases/kernel/syscalls/pkeys/pkey01.c @@ -43,14 +43,15 @@ static int size; static int execute_supported = 1; +#define PERM_NAME(x) .access_rights = x, .name = #x static struct tcase { unsigned long flags; unsigned long access_rights; char *name; } tcases[] = { - {0, PKEY_DISABLE_ACCESS, "PKEY_DISABLE_ACCESS"}, - {0, PKEY_DISABLE_WRITE, "PKEY_DISABLE_WRITE"}, - {0, PKEY_DISABLE_EXECUTE, "PKEY_DISABLE_EXECUTE"}, + {PERM_NAME(PKEY_DISABLE_ACCESS)}, + {PERM_NAME(PKEY_DISABLE_WRITE)}, + {PERM_NAME(PKEY_DISABLE_EXECUTE)}, }; static void setup(void)