Linux 4.13: use designated initializers where required 63/12663/4
authorStephan Wiesand <stephan.wiesand@desy.de>
Mon, 24 Jul 2017 09:37:54 +0000 (11:37 +0200)
committerBenjamin Kaduk <kaduk@mit.edu>
Wed, 26 Jul 2017 12:27:00 +0000 (08:27 -0400)
struct path is declared with the "designated_init" attribute,
and module builds now use -Werror=designated-init. Cope.

And as pointed out by Michael Meffie, struct ctl_table has
the same requirement now, so use a designated initializer
for the final element of the sysctl table too.

Change-Id: I0ec45aac961dcefa0856a15ee218085626a357c7
Reviewed-on: https://gerrit.openafs.org/12663
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>

src/afs/LINUX/osi_misc.c
src/afs/LINUX/osi_sysctl.c

index 627b477..077d4ed 100644 (file)
@@ -140,7 +140,7 @@ int osi_abspath(char *aname, char *buf, int buflen,
     code = osi_lookupname_internal(name, followlink, &mnt, &dp);
     if (!code) {
 #if defined(D_PATH_TAKES_STRUCT_PATH)
-       afs_linux_path_t p = { mnt, dp };
+       afs_linux_path_t p = { .mnt = mnt, .dentry = dp };
        path = d_path(&p, buf, buflen);
 #else
        path = d_path(dp, mnt, buf, buflen);
index 2b1be3b..4d56c4e 100644 (file)
@@ -231,7 +231,9 @@ static struct ctl_table afs_sysctl_table[] = {
        .mode           = 0644,
        .proc_handler   = &proc_dointvec
     },
-    {0}
+    {
+       .procname       = 0
+    }
 };
 
 static struct ctl_table fs_sysctl_table[] = {
@@ -247,7 +249,9 @@ static struct ctl_table fs_sysctl_table[] = {
        .mode           = 0555, 
        .child          = afs_sysctl_table
     },
-    {0}
+    {
+       .procname       = 0
+    }
 };
 
 int