diff mbox series

[ndctl] ndctl/lib: make dimm_ops in private.h extern

Message ID 20200130185631.29817-1-vishal.l.verma@intel.com (mailing list archive)
State New, archived
Headers show
Series [ndctl] ndctl/lib: make dimm_ops in private.h extern | expand

Commit Message

Verma, Vishal L Jan. 30, 2020, 6:56 p.m. UTC
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

Cc: Dan Williams <dan.j.williams@intel.com>
Suggested-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 ndctl/lib/private.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Dan Williams Jan. 30, 2020, 7:03 p.m. UTC | #1
On Thu, Jan 30, 2020 at 10:56 AM Vishal Verma <vishal.l.verma@intel.com> wrote:
>
> 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?
Verma, Vishal L Jan. 30, 2020, 7:05 p.m. UTC | #2
On Thu, 2020-01-30 at 11:03 -0800, Dan Williams wrote:
> On Thu, Jan 30, 2020 at 10:56 AM Vishal Verma <vishal.l.verma@intel.com> wrote:
> > 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.
Jeff Moyer Feb. 18, 2020, 9:33 p.m. UTC | #3
Vishal Verma <vishal.l.verma@intel.com> writes:

> 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
>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Suggested-by: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
>  ndctl/lib/private.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/ndctl/lib/private.h b/ndctl/lib/private.h
> index e445301..16bf8f9 100644
> --- a/ndctl/lib/private.h
> +++ b/ndctl/lib/private.h
> @@ -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)
>  {

Acked-by: Jeff Moyer <jmoyer@redhat.com>
diff mbox series

Patch

diff --git a/ndctl/lib/private.h b/ndctl/lib/private.h
index e445301..16bf8f9 100644
--- a/ndctl/lib/private.h
+++ b/ndctl/lib/private.h
@@ -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)
 {