From 7cdc62964119f5f13070d0549d157e4a6135dc5c Mon Sep 17 00:00:00 2001 From: Steve Guminski Date: Fri, 19 May 2017 15:25:37 -0400 Subject: [PATCH] LU-6210 utils: Use C99 initializer for lfsck_types_names This patch makes no functional changes. The lfsck_types_names struct initializer in lustre_lfsck.c is updated to C99 syntax. C89 positional initializers require values to be placed in the correct order. This will cause errors if the fields of the struct definition are reordered or fields are added or removed. C99 named initializers avoid this problem, and also automatically clear any values that are not explicitly set. Test-Parameters: trivial Lustre-change: https://review.whamcloud.com/27791 Lustre-commit: a1d62378ed98e2663c1f95f955433e2a5b13d68c Signed-off-by: Steve Guminski Change-Id: I8a3b44b56263b00a926550e4122193300c0c399f Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Fan Yong Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/30264 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: John L. Hammond --- lustre/utils/lustre_lfsck.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lustre/utils/lustre_lfsck.c b/lustre/utils/lustre_lfsck.c index 94f0b2b..14c569d 100644 --- a/lustre/utils/lustre_lfsck.c +++ b/lustre/utils/lustre_lfsck.c @@ -91,13 +91,12 @@ struct lfsck_type_name { }; static struct lfsck_type_name lfsck_types_names[] = { - { "scrub", LFSCK_TYPE_SCRUB }, - { "layout", LFSCK_TYPE_LAYOUT }, - { "namespace", LFSCK_TYPE_NAMESPACE }, - { "default", LFSCK_TYPES_DEF }, - { "all", LFSCK_TYPES_SUPPORTED }, - { NULL, 0 } -}; + { .ltn_name = "all", .ltn_type = LFSCK_TYPES_SUPPORTED }, + { .ltn_name = "default", .ltn_type = LFSCK_TYPES_DEF }, + { .ltn_name = "layout", .ltn_type = LFSCK_TYPE_LAYOUT }, + { .ltn_name = "namespace", .ltn_type = LFSCK_TYPE_NAMESPACE }, + { .ltn_name = "scrub", .ltn_type = LFSCK_TYPE_SCRUB }, + { .ltn_name = NULL } }; static enum lfsck_type lfsck_name2type(const char *name) { -- 1.8.3.1