From: Tom Rix <trix@redhat.com>
To: shannon.nelson@amd.com, brett.creeley@amd.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Tom Rix <trix@redhat.com>
Subject: [PATCH] pds_core: add stub macros for pdsc_debufs_* when ! CONFIG_DEBUG_FS
Date: Tue, 2 May 2023 10:52:20 -0400 [thread overview]
Message-ID: <20230502145220.2927464-1-trix@redhat.com> (raw)
When CONFIG_DEBUG_FS is not defined there is this representative link error
ld: drivers/net/ethernet/amd/pds_core/main.o: in function `pdsc_remove':
main.c:(.text+0x35c): undefined reference to `pdsc_debugfs_del_dev
Avoid these link errors when CONFIG_DEBUG_FS is not defined by
providing some empty macros.
Signed-off-by: Tom Rix <trix@redhat.com>
---
drivers/net/ethernet/amd/pds_core/core.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/amd/pds_core/core.h b/drivers/net/ethernet/amd/pds_core/core.h
index e545fafc4819..0b39a6dc65c8 100644
--- a/drivers/net/ethernet/amd/pds_core/core.h
+++ b/drivers/net/ethernet/amd/pds_core/core.h
@@ -261,6 +261,7 @@ int pdsc_dl_enable_validate(struct devlink *dl, u32 id,
void __iomem *pdsc_map_dbpage(struct pdsc *pdsc, int page_num);
+#ifdef CONFIG_DEBUG_FS
void pdsc_debugfs_create(void);
void pdsc_debugfs_destroy(void);
void pdsc_debugfs_add_dev(struct pdsc *pdsc);
@@ -270,6 +271,17 @@ void pdsc_debugfs_add_viftype(struct pdsc *pdsc);
void pdsc_debugfs_add_irqs(struct pdsc *pdsc);
void pdsc_debugfs_add_qcq(struct pdsc *pdsc, struct pdsc_qcq *qcq);
void pdsc_debugfs_del_qcq(struct pdsc_qcq *qcq);
+#else
+#define pdsc_debugfs_create()
+#define pdsc_debugfs_destroy()
+#define pdsc_debugfs_add_dev(pdsc)
+#define pdsc_debugfs_del_dev(pdsc)
+#define pdsc_debugfs_add_ident(pdsc)
+#define pdsc_debugfs_add_viftype(pdsc)
+#define pdsc_debugfs_add_irqs(pdsc)
+#define pdsc_debugfs_add_qcq(pdsc, qcq)
+#define pdsc_debugfs_del_qcq(qcq)
+#endif
int pdsc_err_to_errno(enum pds_core_status_code code);
bool pdsc_is_fw_running(struct pdsc *pdsc);
--
2.27.0
next reply other threads:[~2023-05-02 14:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-02 14:52 Tom Rix [this message]
2023-05-02 14:57 ` [PATCH] pds_core: add stub macros for pdsc_debufs_* when ! CONFIG_DEBUG_FS Paolo Abeni
2023-05-03 7:36 ` Jiri Pirko
2023-05-03 12:32 ` Tom Rix
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=20230502145220.2927464-1-trix@redhat.com \
--to=trix@redhat.com \
--cc=brett.creeley@amd.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shannon.nelson@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).