lustre: obdclass: use c99 initializers in structures
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 23 Aug 2014 11:20:27 +0000 (13:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Aug 2014 19:03:45 +0000 (12:03 -0700)
Use c99 initializers for structures.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@decl@
identifier i1,fld;
type T;
field list[n] fs;
@@

struct i1 {
 fs
 T fld;
 ...};

@bad@
identifier decl.i1,i2;
expression e;
initializer list[decl.n] is;
@@

struct i1 i2 = { is,
+ .fld = e
- e
 ,...};
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
drivers/staging/lustre/lustre/obdclass/obd_mount.c

index 1dbb30947bec8b117bea0b6686fe61c49b1ec53e..8ca9afc929aa2ee2d122c715e41b8cd2856b2313 100644 (file)
@@ -1572,7 +1572,10 @@ lproc_exp_hash_seq_show(struct seq_file *m, void *unused)
 {
        struct nid_stat *stats = (struct nid_stat *)m->private;
        struct obd_device *obd = stats->nid_obd;
-       struct exp_hash_cb_data cb_data = {m, true};
+       struct exp_hash_cb_data cb_data = {
+               .m = m,
+               .first = true
+       };
 
        cfs_hash_for_each_key(obd->obd_nid_hash, &stats->nid,
                              lprocfs_exp_print_hash, &cb_data);
index 560a47d4eda4c1d8bbc0b80142b278751d9eeab1..9653b3813ff0443c2eae03a6140f63332474bf40 100644 (file)
@@ -1276,7 +1276,10 @@ EXPORT_SYMBOL(lustre_register_kill_super_cb);
 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,
+               .lmd2_mnt = NULL
+       };
 
        return mount_nodev(fs_type, flags, &lmd2, lustre_fill_super);
 }