linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] swiotlb: fix implicit debugfs_create_dir declaration
@ 2021-06-29  8:11 Claire Chang
  0 siblings, 0 replies; only message in thread
From: Claire Chang @ 2021-06-29  8:11 UTC (permalink / raw)
  To: konrad.wilk, hch, m.szyprowski, robin.murphy
  Cc: iommu, linux-kernel, Claire Chang, kernel test robot

Use __maybe_unused instead of ifdef to fix implicit function declaration
for other pools.

Fixes: 1d9f94400a7a ("swiotlb: Refactor swiotlb_create_debugfs")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Claire Chang <tientzu@chromium.org>
---
 kernel/dma/swiotlb.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 0ffbaae9fba2..508b678f6448 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -36,9 +36,7 @@
 #include <linux/scatterlist.h>
 #include <linux/mem_encrypt.h>
 #include <linux/set_memory.h>
-#ifdef CONFIG_DEBUG_FS
 #include <linux/debugfs.h>
-#endif
 #ifdef CONFIG_DMA_RESTRICTED_POOL
 #include <linux/io.h>
 #include <linux/of.h>
@@ -686,10 +684,9 @@ bool is_swiotlb_active(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(is_swiotlb_active);
 
-#ifdef CONFIG_DEBUG_FS
-static struct dentry *debugfs_dir;
+__maybe_unused static struct dentry *debugfs_dir;
 
-static void swiotlb_create_debugfs_files(struct io_tlb_mem *mem)
+__maybe_unused static void swiotlb_create_debugfs_files(struct io_tlb_mem *mem)
 {
 	debugfs_create_ulong("io_tlb_nslabs", 0400, mem->debugfs, &mem->nslabs);
 	debugfs_create_ulong("io_tlb_used", 0400, mem->debugfs, &mem->used);
@@ -709,8 +706,6 @@ static int __init swiotlb_create_default_debugfs(void)
 
 late_initcall(swiotlb_create_default_debugfs);
 
-#endif
-
 #ifdef CONFIG_DMA_RESTRICTED_POOL
 struct page *swiotlb_alloc(struct device *dev, size_t size)
 {
-- 
2.32.0.93.g670b81a890-goog


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-29  8:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29  8:11 [PATCH] swiotlb: fix implicit debugfs_create_dir declaration Claire Chang

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