Skip to contentSkip to conversation

mm,kmemleak-test: add the dependency on CONFIG_SAMPLES

PATCH Superseded chenxiang 2 participants 3 messages May 26, 2021 – May 27, 2021 Library code

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

chenxiang

author
#0 lore raw

PATCH 1/1 mm,kmemleak-test: add the dependency on CONFIG_SAMPLES

From: Xiang Chen <[email protected]>

As kmemleak-test.c is moved to samples dir, it is not compiled if just setting CONFIG_DEBUG_KMEMLEAK_TEST as module and enabling CONFIG_DEBUG_KMEMLEAK. Because it depends on CONFIG_SAMPLES after it is moved to samples dir.
So the dependency on CONFIG_SAMPLES is added.

Fixes 1abbef4f5172 ("mm,kmemleak-test.c: move kmemleak-test.c to samples dir")
---
 lib/Kconfig.debug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +1 -1
index 2779c29..9950542 100644
@@ -716,7 +716,7 @@ config DEBUG_KMEMLEAK_MEM_POOL_SIZE
 
 config DEBUG_KMEMLEAK_TEST
 	tristate "Simple test for the kernel memory leak detector"
-	depends on DEBUG_KMEMLEAK && m
+	depends on DEBUG_KMEMLEAK && SAMPLES && m
 	help
 	  This option enables a module that explicitly leaks memory.
 
Signature · 1 line
2.8.1
#1 lore raw
Quoted 19 lines · chenxiang

From: Xiang Chen <[email protected]>

As kmemleak-test.c is moved to samples dir, it is not compiled if just setting CONFIG_DEBUG_KMEMLEAK_TEST as module and enabling CONFIG_DEBUG_KMEMLEAK. Because it depends on CONFIG_SAMPLES after it is moved to samples dir.
So the dependency on CONFIG_SAMPLES is added.

Fixes 1abbef4f5172 ("mm,kmemleak-test.c: move kmemleak-test.c to samples dir")
---
 lib/Kconfig.debug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +0 -0
index 2779c29..9950542 100644

lib/Kconfig.debug config DEBUG_KMEMLEAK_MEM_POOL_SIZE · line 721

Quoted 7 lines
lib/Kconfig.debug +1 -1
@@ -716,7 +716,7 @@ config DEBUG_KMEMLEAK_MEM_POOL_SIZE
 
 config DEBUG_KMEMLEAK_TEST
 	tristate "Simple test for the kernel memory leak detector"
-	depends on DEBUG_KMEMLEAK && m
+	depends on DEBUG_KMEMLEAK && SAMPLES && m
 	help
 	  This option enables a module that explicitly leaks memory.

Would it make more sense to move the DEBUG_KMEMLEAK_TEST option to samples as well and maybe rename it to SAMPLES_KMEMLEAK?

Signature · 1 line
Catalin
#2 lore raw

Hi Catalin,

Quoted 21 lines · Catalin Marinas
Quoted 20 lines · chenxiang

From: Xiang Chen <[email protected]>

As kmemleak-test.c is moved to samples dir, it is not compiled if just setting CONFIG_DEBUG_KMEMLEAK_TEST as module and enabling CONFIG_DEBUG_KMEMLEAK. Because it depends on CONFIG_SAMPLES after it is moved to samples dir.
So the dependency on CONFIG_SAMPLES is added.

Fixes 1abbef4f5172 ("mm,kmemleak-test.c: move kmemleak-test.c to samples dir")
---
  lib/Kconfig.debug | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +0 -0
index 2779c29..9950542 100644
@@ -716,7 +716,7 @@ config DEBUG_KMEMLEAK_MEM_POOL_SIZE
 
Quoted 8 lines

lib/Kconfig.debug config DEBUG_KMEMLEAK_MEM_POOL_SIZE · line 721

Quoted 6 lines
lib/Kconfig.debug +1 -1
  config DEBUG_KMEMLEAK_TEST
  	tristate "Simple test for the kernel memory leak detector"
-	depends on DEBUG_KMEMLEAK && m
+	depends on DEBUG_KMEMLEAK && SAMPLES && m
  	help
  	  This option enables a module that explicitly leaks memory.

Would it make more sense to move the DEBUG_KMEMLEAK_TEST option to samples as well and maybe rename it to SAMPLES_KMEMLEAK?

Right, it seems be better to move the option to samples dir and rename it. I will change it in next verison.

Quoted 1 line