* [PATCH] cxl: fix build when CONFIG_DEBUG_FS=n
@ 2017-01-31 14:10 Andrew Donnellan
2017-02-01 2:20 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Donnellan @ 2017-01-31 14:10 UTC (permalink / raw)
To: linuxppc-dev; +Cc: imunsie, fbarrat
Stub out the debugfs functions so that the build doesn't break when
CONFIG_DEBUG_FS=n.
Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
---
drivers/misc/cxl/debugfs.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/drivers/misc/cxl/debugfs.c b/drivers/misc/cxl/debugfs.c
index 9c06ac8fa5ac..af304ba0dc4e 100644
--- a/drivers/misc/cxl/debugfs.c
+++ b/drivers/misc/cxl/debugfs.c
@@ -13,6 +13,8 @@
#include "cxl.h"
+#ifdef CONFIG_DEBUG_FS
+
static struct dentry *cxl_debugfs;
void cxl_stop_trace(struct cxl *adapter)
@@ -151,3 +153,50 @@ void cxl_debugfs_exit(void)
{
debugfs_remove_recursive(cxl_debugfs);
}
+
+#else /* CONFIG_DEBUG_FS */
+
+void cxl_stop_trace(struct cxl *cxl)
+{
+}
+
+void cxl_debugfs_add_adapter_psl_regs(struct cxl *adapter, struct dentry *dir)
+{
+}
+
+void cxl_debugfs_add_adapter_xsl_regs(struct cxl *adapter, struct dentry *dir)
+{
+}
+
+int cxl_debugfs_adapter_add(struct cxl *adapter)
+{
+ return 0;
+}
+
+void cxl_debugfs_adapter_remove(struct cxl *adapter)
+{
+}
+
+void cxl_debugfs_add_afu_psl_regs(struct cxl_afu *afu, struct dentry *dir)
+{
+}
+
+int cxl_debugfs_afu_add(struct cxl_afu *afu)
+{
+ return 0;
+}
+
+void cxl_debugfs_afu_remove(struct cxl_afu *afu)
+{
+}
+
+int __init cxl_debugfs_init(void)
+{
+ return 0;
+}
+
+void cxl_debugfs_exit(void)
+{
+}
+
+#endif /* CONFIG_DEBUG_FS */
--
Andrew Donnellan OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com IBM Australia Limited
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cxl: fix build when CONFIG_DEBUG_FS=n
2017-01-31 14:10 [PATCH] cxl: fix build when CONFIG_DEBUG_FS=n Andrew Donnellan
@ 2017-02-01 2:20 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2017-02-01 2:20 UTC (permalink / raw)
To: Andrew Donnellan, linuxppc-dev; +Cc: imunsie, fbarrat
Andrew Donnellan <andrew.donnellan@au1.ibm.com> writes:
> Stub out the debugfs functions so that the build doesn't break when
> CONFIG_DEBUG_FS=n.
It's not a big deal, but it's preferable to do the stubs as static
inlines in a header. That way they generate no code.
Doing it this way, in a C file, you'll still get lots of one and two
instruction functions generated in your vmlinux, which is less neat.
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-02-01 2:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-31 14:10 [PATCH] cxl: fix build when CONFIG_DEBUG_FS=n Andrew Donnellan
2017-02-01 2:20 ` Michael Ellerman
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).