Whamcloud - gitweb
LU-6210 utils: Use C99 initializer for lfsck_types_names 91/27791/2
authorSteve Guminski <stephenx.guminski@intel.com>
Fri, 19 May 2017 19:25:37 +0000 (15:25 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 19 Jul 2017 03:31:54 +0000 (03:31 +0000)
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
Signed-off-by: Steve Guminski <stephenx.guminski@intel.com>
Change-Id: I8a3b44b56263b00a926550e4122193300c0c399f
Reviewed-on: https://review.whamcloud.com/27791
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
lustre/utils/lustre_lfsck.c

index b09742b..f3b00f0 100644 (file)
@@ -89,13 +89,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)
 {