Whamcloud - gitweb
LU-6210 fid: Change positional struct initializers to C99 89/23789/2
authorSteve Guminski <stephenx.guminski@intel.com>
Wed, 16 Nov 2016 14:24:34 +0000 (09:24 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 1 Jan 2017 02:00:58 +0000 (02:00 +0000)
This patch makes no functional changes.  Struct initializers in the
fid directory that use C89 or GCC-only syntax are updated to C99
syntax.

The C99 syntax prevents incorrect initialization if values are
accidently placed in the wrong position, allows changes in the struct
definition, and clears any members that are not given an explicit
value.

The following struct initializers have been updated:

lustre/fid/fid_lib.c:
const struct lu_seq_range LUSTRE_SEQ_SPACE_RANGE
const struct lu_seq_range LUSTRE_SEQ_ZERO_RANGE
lustre/fid/lproc_fid.c:
struct lu_seq_range tmp

Test-Parameters: trivial
Signed-off-by: Steve Guminski <stephenx.guminski@intel.com>
Change-Id: I73b6a37a0fcac29ba48410e7befb98f13bdb17cc
Reviewed-on: https://review.whamcloud.com/23789
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/fid/fid_lib.c
lustre/fid/lproc_fid.c

index d3cd115..7c5477c 100644 (file)
  * FID_SEQ_START + 2 is for .lustre directory and its objects
  */
 const struct lu_seq_range LUSTRE_SEQ_SPACE_RANGE = {
-        FID_SEQ_NORMAL,
-        (__u64)~0ULL
+       .lsr_start      = FID_SEQ_NORMAL,
+       .lsr_end        = (__u64)~0ULL,
 };
 
 /* Zero range, used for init and other purposes. */
 const struct lu_seq_range LUSTRE_SEQ_ZERO_RANGE = {
-        0,
-        0
+       .lsr_start = 0,
 };
 
 /* Lustre Big Fs Lock fid. */
index 3fc2481..11ae1b6 100644 (file)
@@ -63,7 +63,9 @@ static int
 lprocfs_fid_write_common(const char __user *buffer, size_t count,
                                struct lu_seq_range *range)
 {
-       struct lu_seq_range tmp = { 0, };
+       struct lu_seq_range tmp = {
+               .lsr_start = 0,
+       };
        char kernbuf[MAX_FID_RANGE_STRLEN];
        ENTRY;