ndctl/lib: fix symbol redefinitions reported by GCC10
Vishal Verma
maintainerPATCH v3 1/1 ndctl/lib: fix symbol redefinitions reported by GCC10
A toolchain update in Fedora 32 caused new compile errors due to multiple definitions of dimm_ops structures. The declarations in 'private.h' for the various NFIT families are present so that libndctl can find all the per-family dimm-ops. However they need to be declared as extern because the actual definitions are in <family>.c. Additionally, 'param' instances in list.c and monitor.c need to be marked as static.
Cc Dan Williams <[email protected]>
Cc Eric Sandeen <[email protected]>
Suggested-by Dan Williams <[email protected]>
Reviewed-by Dan Williams <[email protected]>
Signed-off-by Vishal Verma <[email protected]>
---
v3: Remove unrelated changes to Makefile.am from this patch (Eric).
ndctl/lib/private.h | 8 ++++---- ndctl/list.c | 2 +- ndctl/monitor.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
ndctl/lib/private.h +4 -4
@@ -343,10 +343,10 @@ struct ndctl_dimm_ops {int (*xlat_firmware_status)(struct ndctl_cmd *); }; -struct ndctl_dimm_ops *const intel_dimm_ops; -struct ndctl_dimm_ops *const hpe1_dimm_ops; -struct ndctl_dimm_ops *const msft_dimm_ops; -struct ndctl_dimm_ops *const hyperv_dimm_ops; +extern struct ndctl_dimm_ops *const intel_dimm_ops; +extern struct ndctl_dimm_ops *const hpe1_dimm_ops; +extern struct ndctl_dimm_ops *const msft_dimm_ops; +extern struct ndctl_dimm_ops *const hyperv_dimm_ops;static inline struct ndctl_bus *cmd_to_bus (struct ndctl_cmd *cmd) {
ndctl/list.c +1 -1
@@ -59,7 +59,7 @@ static unsigned long listopts_to_flags(void)return flags; } -struct util_filter_params param; +static struct util_filter_params param;static int did_fail;
ndctl/monitor.c +1 -1
@@ -45,7 +45,7 @@ struct monitor_dimm {struct list_node list; }; -struct util_filter_params param; +static struct util_filter_params param;static int did_fail;
Signature · 4 lines
2.21.1 _______________________________________________ Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]