Skip to content

Commit

Permalink
pkey01: Simplify struct initialization
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Vorel <[email protected]>
  • Loading branch information
pevik committed Aug 9, 2024
1 parent d2b8a47 commit 863c7d2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions testcases/kernel/syscalls/pkeys/pkey01.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 863c7d2

Please sign in to comment.