mm/cma: drop CONFIG_CMA_DEBUG
authorAnshuman Khandual <anshuman.khandual@arm.com>
Mon, 5 Feb 2024 03:16:47 +0000 (08:46 +0530)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 22 Feb 2024 18:24:53 +0000 (10:24 -0800)
All pr_debug() prints in (mm/cma.c) could be enabled via standard Makefile
based method.  Besides cma_debug_show_areas() should always be called
during cma_alloc() failure path.  This seemingly redundant config,
CONFIG_CMA_DEBUG can be dropped without any problem.

[lukas.bulwahn@gmail.com: remove debug code to removed CONFIG_CMA_DEBUG]
Link: https://lkml.kernel.org/r/20240207143825.986-1-lukas.bulwahn@gmail.com
Link: https://lkml.kernel.org/r/20240205031647.283510-1-anshuman.khandual@arm.com
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/dma/contiguous.c
mm/Kconfig
mm/cma.c

index f005c66f378c32e9bae2d84b0ca80d1c126f0c15..055da410ac71d6b8a3d7100fa8000c53daa3f44e 100644 (file)
 
 #define pr_fmt(fmt) "cma: " fmt
 
-#ifdef CONFIG_CMA_DEBUG
-#ifndef DEBUG
-#  define DEBUG
-#endif
-#endif
-
 #include <asm/page.h>
 
 #include <linux/memblock.h>
index ffc3a2ba3a8cd85e2e6d95606bcab1510ce0d679..35fa9940e61fe4bc7e1fba2524a347f7d29051b5 100644 (file)
@@ -901,15 +901,6 @@ config CMA
 
          If unsure, say "n".
 
-config CMA_DEBUG
-       bool "CMA debug messages (DEVELOPMENT)"
-       depends on DEBUG_KERNEL && CMA
-       help
-         Turns on debug messages in CMA.  This produces KERN_DEBUG
-         messages for every CMA call as well as various messages while
-         processing calls such as dma_alloc_from_contiguous().
-         This option does not affect warning and error messages.
-
 config CMA_DEBUGFS
        bool "CMA debugfs interface"
        depends on CMA && DEBUG_FS
index b6720930312df20b123f0269135d8b732b447f2c..4902bbfe24f121df47636043931d3656b167444c 100644 (file)
--- a/mm/cma.c
+++ b/mm/cma.c
 
 #define pr_fmt(fmt) "cma: " fmt
 
-#ifdef CONFIG_CMA_DEBUG
-#ifndef DEBUG
-#  define DEBUG
-#endif
-#endif
 #define CREATE_TRACE_POINTS
 
 #include <linux/memblock.h>
@@ -387,7 +382,6 @@ err:
        return ret;
 }
 
-#ifdef CONFIG_CMA_DEBUG
 static void cma_debug_show_areas(struct cma *cma)
 {
        unsigned long next_zero_bit, next_set_bit, nr_zero;
@@ -412,9 +406,6 @@ static void cma_debug_show_areas(struct cma *cma)
        pr_cont("=> %lu free of %lu total pages\n", nr_total, cma->count);
        spin_unlock_irq(&cma->lock);
 }
-#else
-static inline void cma_debug_show_areas(struct cma *cma) { }
-#endif
 
 /**
  * cma_alloc() - allocate pages from contiguous area