[PATCH] cxl: fix build when CONFIG_DEBUG_FS=n

Subsystems: char and misc drivers, the rest

STALE3543d

2 messages, 2 authors, 2017-02-01 · open the first message on its own page

[PATCH] cxl: fix build when CONFIG_DEBUG_FS=n

From: Andrew Donnellan <hidden>
Date: 2017-01-31 14:11:11

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 <redacted>
---
 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

Re: [PATCH] cxl: fix build when CONFIG_DEBUG_FS=n

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2017-02-01 02:20:23

Andrew Donnellan [off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help