From: Steve Guminski Date: Mon, 7 Nov 2016 18:52:20 +0000 (-0500) Subject: LU-6210 obd: Change positional struct initializers to C99 X-Git-Tag: 2.9.52~61 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=4ddad88d15d8f9e36c5cbb9fd5611a3d8e16ea8c LU-6210 obd: Change positional struct initializers to C99 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 Change-Id: I74a7d6ebb250e8df0f24f60ce87933fddf325c30 Reviewed-on: https://review.whamcloud.com/23697 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- diff --git a/lustre/obdclass/lprocfs_jobstats.c b/lustre/obdclass/lprocfs_jobstats.c index 20f28b8..a341794 100644 --- a/lustre/obdclass/lprocfs_jobstats.c +++ b/lustre/obdclass/lprocfs_jobstats.c @@ -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 = { - 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) diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index 796b43d..dc89df2 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -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) { - 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); diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 6be08e1..4869da4 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -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) { - 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); } @@ -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) { - 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); }