Linux 4.14 compat: CONFIG_GCC_PLUGIN_RANDSTRUCT

Fix build errors with gcc 7.2.0 on Gentoo with kernel 4.14
built with CONFIG_GCC_PLUGIN_RANDSTRUCT=y such as:

module/nvpair/nvpair.c:2810:2:error:
positional initialization of field in ?struct? declared with
'designated_init' attribute [-Werror=designated-init]
  nvs_native_nvlist,
  ^~~~~~~~~~~~~~~~~

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mark Wright <gienah@gentoo.org>
Closes #5390 
Closes #6903
This commit is contained in:
Mark Wright
2017-11-29 10:33:48 +11:00
committed by Brian Behlendorf
parent 48ac22d855
commit 56d8d8ace4
12 changed files with 126 additions and 124 deletions
+10 -10
View File
@@ -2807,11 +2807,11 @@ nvs_native_nvpair(nvstream_t *nvs, nvpair_t *nvp, size_t *size)
}
static const nvs_ops_t nvs_native_ops = {
nvs_native_nvlist,
nvs_native_nvpair,
nvs_native_nvp_op,
nvs_native_nvp_size,
nvs_native_nvl_fini
.nvs_nvlist = nvs_native_nvlist,
.nvs_nvpair = nvs_native_nvpair,
.nvs_nvp_op = nvs_native_nvp_op,
.nvs_nvp_size = nvs_native_nvp_size,
.nvs_nvl_fini = nvs_native_nvl_fini
};
static int
@@ -3294,11 +3294,11 @@ nvs_xdr_nvpair(nvstream_t *nvs, nvpair_t *nvp, size_t *size)
}
static const struct nvs_ops nvs_xdr_ops = {
nvs_xdr_nvlist,
nvs_xdr_nvpair,
nvs_xdr_nvp_op,
nvs_xdr_nvp_size,
nvs_xdr_nvl_fini
.nvs_nvlist = nvs_xdr_nvlist,
.nvs_nvpair = nvs_xdr_nvpair,
.nvs_nvp_op = nvs_xdr_nvp_op,
.nvs_nvp_size = nvs_xdr_nvp_size,
.nvs_nvl_fini = nvs_xdr_nvl_fini
};
static int