[PATCH] KEYS: encrypted: Use designated initializers for match_table_t structs

Thorsten Blum
2025-10-09T11:59:41Z

Use designated initializers for 'key_format_tokens' and 'key_tokens' to
allow struct fields to be reordered more easily and to improve
readability.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
security/keys/encrypted-keys/encrypted.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/security/keys/encrypted-keys/encrypted.c b/security/keys/encrypted-keys/encrypted.c
index aef438d18da8..76a6dab2f4d2 100644
--- a/security/keys/encrypted-keys/encrypted.c
+++ b/security/keys/encrypted-keys/encrypted.c
@@ -62,17 +62,17 @@ enum {
};

static const match_table_t key_format_tokens = {
- {Opt_default, "default"},
- {Opt_ecryptfs, "ecryptfs"},
- {Opt_enc32, "enc32"},
- {Opt_error, NULL}
+ { .token = Opt_default, .pattern = "default"},
+ { .token = Opt_ecryptfs, .pattern = "ecryptfs"},
+ { .token = Opt_enc32, .pattern = "enc32"},
+ { .token = Opt_error, .pattern = NULL}
};

static const match_table_t key_tokens = {
- {Opt_new, "new"},
- {Opt_load, "load"},
- {Opt_update, "update"},
- {Opt_err, NULL}
+ { .token = Opt_new, .pattern = "new"},
+ { .token = Opt_load, .pattern = "load"},
+ { .token = Opt_update, .pattern = "update"},
+ { .token = Opt_err, .pattern = NULL}
};

static bool user_decrypted_data = IS_ENABLED(CONFIG_USER_DECRYPTED_DATA);
--
2.51.0