Skip to contentSkip to conversation

ndctl/lib: make dimm_ops in private.h extern

PATCH In review Vishal Verma 3 participants 4 messages Jan 30, 2020 – Feb 18, 2020 libnvdimm: non-volatile memory device

lore
Share & tools
lore

Vishal Verma

author maintainer
#0 lore raw

PATCH 1/1 ndctl/lib: make dimm_ops in private.h extern

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

---
 ndctl/lib/private.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
ndctl/lib/private.h +4 -4
index e445301..16bf8f9 100644
@@ -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)
 {
Signature · 4 lines
2.21.1
_______________________________________________
Linux-nvdimm mailing list -- [email protected]
To unsubscribe send an email to [email protected]
#1 lore raw
Quoted 6 lines · Vishal Verma

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

Looks good to me. Does this quiet the build spew?
_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]

author maintainer
#2 lore raw
Quoted 8 lines · Dan Williams
Quoted 5 lines · Vishal Verma

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

Looks good to me. Does this quiet the build spew?

I'm testing that now - it at least doesn't introduce any new errors in my F30 environment and makes sense.

_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]

Acked-by on v1 1/1
#3 lore raw
In reply to Vishal Verma
Quoted 22 lines · Vishal Verma

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

---
 ndctl/lib/private.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
ndctl/lib/private.h +0 -1
index e445301..16bf8f9 100644
@@ -343,10 +343,10 @@ struct ndctl_dimm_ops {
 	int (*xlat_firmware_status)(struct ndctl_cmd *);
 };
 
-struct ndctl_dimm_ops * const intel_dimm_ops;

ndctl/lib/private.h struct ndctl_dimm_ops { · line 352

Quoted 10 lines
ndctl/lib/private.h +4 -3
-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)
 {

_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]