All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vishal Verma <vishal.l.verma@intel.com>
To: <linux-nvdimm@lists.01.org>
Cc: Eric Sandeen <sandeen@redhat.com>
Subject: [ndctl PATCH v3] ndctl/lib: fix symbol redefinitions reported by GCC10
Date: Fri, 31 Jan 2020 13:06:30 -0700	[thread overview]
Message-ID: <20200131200630.17582-1-vishal.l.verma@intel.com> (raw)

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 <dan.j.williams@intel.com>
Cc: Eric Sandeen <sandeen@redhat.com>
Suggested-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---

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(-)

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)
 {
diff --git a/ndctl/list.c b/ndctl/list.c
index 125a9fe..12d78d8 100644
--- a/ndctl/list.c
+++ b/ndctl/list.c
@@ -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;
 
diff --git a/ndctl/monitor.c b/ndctl/monitor.c
index b8ee27f..1755b87 100644
--- a/ndctl/monitor.c
+++ b/ndctl/monitor.c
@@ -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;
 
-- 
2.21.1
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

                 reply	other threads:[~2020-01-31 20:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200131200630.17582-1-vishal.l.verma@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=sandeen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.