Whamcloud - gitweb
LU-6210 obd: Change positional struct initializers to C99 97/23697/3
authorSteve Guminski <stephenx.guminski@intel.com>
Mon, 7 Nov 2016 18:52:20 +0000 (13:52 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 1 Jan 2017 02:00:39 +0000 (02:00 +0000)
This patch makes no functional changes.  Struct initializers in the
obd directory that use C89 or GCC-only syntax are updated to C99
syntax.  Whitespace is changed to match the code style guidelines.

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/obdclass/lprocfs_jobstats.c:
static const struct seq_operations lprocfs_jobstats_seq_sops
lustre/obdclass/obd_config.c:
struct llog_process_cat_data
lustre/obdclass/obd_mount.c:
struct lustre_mount_data2 lmd2 (2 occurrences)

Test-Parameters: trivial
Signed-off-by: Steve Guminski <stephenx.guminski@intel.com>
Change-Id: I74a7d6ebb250e8df0f24f60ce87933fddf325c30
Reviewed-on: https://review.whamcloud.com/23697
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/obdclass/lprocfs_jobstats.c
lustre/obdclass/obd_config.c
lustre/obdclass/obd_mount.c

index 20f28b8..a341794 100644 (file)
@@ -477,10 +477,10 @@ static int lprocfs_jobstats_seq_show(struct seq_file *p, void *v)
 }
 
 static const struct seq_operations lprocfs_jobstats_seq_sops = {
 }
 
 static const struct seq_operations lprocfs_jobstats_seq_sops = {
-       start: lprocfs_jobstats_seq_start,
-       stop:  lprocfs_jobstats_seq_stop,
-       next:  lprocfs_jobstats_seq_next,
-       show:  lprocfs_jobstats_seq_show,
+       .start  = lprocfs_jobstats_seq_start,
+       .stop   = lprocfs_jobstats_seq_stop,
+       .next   = lprocfs_jobstats_seq_next,
+       .show   = lprocfs_jobstats_seq_show,
 };
 
 static int lprocfs_jobstats_seq_open(struct inode *inode, struct file *file)
 };
 
 static int lprocfs_jobstats_seq_open(struct inode *inode, struct file *file)
index 796b43d..dc89df2 100644 (file)
@@ -1717,10 +1717,12 @@ EXPORT_SYMBOL(class_config_llog_handler);
 int class_config_parse_llog(const struct lu_env *env, struct llog_ctxt *ctxt,
                            char *name, struct config_llog_instance *cfg)
 {
 int class_config_parse_llog(const struct lu_env *env, struct llog_ctxt *ctxt,
                            char *name, struct config_llog_instance *cfg)
 {
-       struct llog_process_cat_data     cd = {0, 0};
-       struct llog_handle              *llh;
-       llog_cb_t                        callback;
-       int                              rc;
+       struct llog_process_cat_data cd = {
+               .lpcd_first_idx = 0,
+       };
+       struct llog_handle *llh;
+       llog_cb_t callback;
+       int rc;
        ENTRY;
 
        CDEBUG(D_INFO, "looking up llog %s\n", name);
        ENTRY;
 
        CDEBUG(D_INFO, "looking up llog %s\n", name);
index 6be08e1..4869da4 100644 (file)
@@ -1522,7 +1522,9 @@ EXPORT_SYMBOL(lustre_register_kill_super_cb);
 static struct dentry *lustre_mount(struct file_system_type *fs_type, int flags,
                                   const char *devname, void *data)
 {
 static struct dentry *lustre_mount(struct file_system_type *fs_type, int flags,
                                   const char *devname, void *data)
 {
-       struct lustre_mount_data2 lmd2 = { data, NULL };
+       struct lustre_mount_data2 lmd2 = {
+               .lmd2_data = data,
+       };
 
        return mount_nodev(fs_type, flags, &lmd2, lustre_fill_super);
 }
 
        return mount_nodev(fs_type, flags, &lmd2, lustre_fill_super);
 }
@@ -1530,7 +1532,10 @@ static struct dentry *lustre_mount(struct file_system_type *fs_type, int flags,
 static int lustre_get_sb(struct file_system_type *fs_type, int flags,
                         const char *devname, void *data, struct vfsmount *mnt)
 {
 static int lustre_get_sb(struct file_system_type *fs_type, int flags,
                         const char *devname, void *data, struct vfsmount *mnt)
 {
-       struct lustre_mount_data2 lmd2 = { data, mnt };
+       struct lustre_mount_data2 lmd2 = {
+               .lmd2_data = data,
+               .lmd2_mnt = mnt,
+       };
 
        return get_sb_nodev(fs_type, flags, &lmd2, lustre_fill_super, mnt);
 }
 
        return get_sb_nodev(fs_type, flags, &lmd2, lustre_fill_super, mnt);
 }