diff options
author | Mark Wright <[email protected]> | 2017-11-29 10:33:48 +1100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-11-28 17:33:48 -0600 |
commit | 56d8d8ace4724bde16145be25b75d8f551961813 (patch) | |
tree | a8b73d0e193fa5a6c649ff6318466a7fc29c932c /module/nvpair | |
parent | 48ac22d8559313b2a33a80b9690aeea9acb9976c (diff) |
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 <[email protected]>
Signed-off-by: Mark Wright <[email protected]>
Closes #5390
Closes #6903
Diffstat (limited to 'module/nvpair')
-rw-r--r-- | module/nvpair/nvpair.c | 20 | ||||
-rw-r--r-- | module/nvpair/nvpair_alloc_fixed.c | 10 | ||||
-rw-r--r-- | module/nvpair/nvpair_alloc_spl.c | 30 |
3 files changed, 30 insertions, 30 deletions
diff --git a/module/nvpair/nvpair.c b/module/nvpair/nvpair.c index 5ce389f14..512f9a998 100644 --- a/module/nvpair/nvpair.c +++ b/module/nvpair/nvpair.c @@ -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 diff --git a/module/nvpair/nvpair_alloc_fixed.c b/module/nvpair/nvpair_alloc_fixed.c index e3ac12938..0d4e12b97 100644 --- a/module/nvpair/nvpair_alloc_fixed.c +++ b/module/nvpair/nvpair_alloc_fixed.c @@ -110,11 +110,11 @@ nv_fixed_reset(nv_alloc_t *nva) } const nv_alloc_ops_t nv_fixed_ops_def = { - nv_fixed_init, /* nv_ao_init() */ - NULL, /* nv_ao_fini() */ - nv_fixed_alloc, /* nv_ao_alloc() */ - nv_fixed_free, /* nv_ao_free() */ - nv_fixed_reset /* nv_ao_reset() */ + .nv_ao_init = nv_fixed_init, + .nv_ao_fini = NULL, + .nv_ao_alloc = nv_fixed_alloc, + .nv_ao_free = nv_fixed_free, + .nv_ao_reset = nv_fixed_reset }; const nv_alloc_ops_t *nv_fixed_ops = &nv_fixed_ops_def; diff --git a/module/nvpair/nvpair_alloc_spl.c b/module/nvpair/nvpair_alloc_spl.c index bc377ab66..ed8fa4d09 100644 --- a/module/nvpair/nvpair_alloc_spl.c +++ b/module/nvpair/nvpair_alloc_spl.c @@ -53,27 +53,27 @@ nv_free_spl(nv_alloc_t *nva, void *buf, size_t size) } const nv_alloc_ops_t spl_sleep_ops_def = { - NULL, /* nv_ao_init() */ - NULL, /* nv_ao_fini() */ - nv_alloc_sleep_spl, /* nv_ao_alloc() */ - nv_free_spl, /* nv_ao_free() */ - NULL /* nv_ao_reset() */ + .nv_ao_init = NULL, + .nv_ao_fini = NULL, + .nv_ao_alloc = nv_alloc_sleep_spl, + .nv_ao_free = nv_free_spl, + .nv_ao_reset = NULL }; const nv_alloc_ops_t spl_pushpage_ops_def = { - NULL, /* nv_ao_init() */ - NULL, /* nv_ao_fini() */ - nv_alloc_pushpage_spl, /* nv_ao_alloc() */ - nv_free_spl, /* nv_ao_free() */ - NULL /* nv_ao_reset() */ + .nv_ao_init = NULL, + .nv_ao_fini = NULL, + .nv_ao_alloc = nv_alloc_pushpage_spl, + .nv_ao_free = nv_free_spl, + .nv_ao_reset = NULL }; const nv_alloc_ops_t spl_nosleep_ops_def = { - NULL, /* nv_ao_init() */ - NULL, /* nv_ao_fini() */ - nv_alloc_nosleep_spl, /* nv_ao_alloc() */ - nv_free_spl, /* nv_ao_free() */ - NULL /* nv_ao_reset() */ + .nv_ao_init = NULL, + .nv_ao_fini = NULL, + .nv_ao_alloc = nv_alloc_nosleep_spl, + .nv_ao_free = nv_free_spl, + .nv_ao_reset = NULL }; nv_alloc_t nv_alloc_sleep_def = { |