Skip to contentSkip to conversation

syscalls/swapping01: Use .needs_kconfigs instead of .setup

PATCH New Bogdan Lezhepekov via ltp 1 participant 1 message Feb 11, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syscalls/swapping01: Use .needs_kconfigs instead of .setup

needs_kconfigs is more beneficial for docparser

---
 testcases/kernel/mem/swapping/swapping01.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
testcases/kernel/mem/swapping/swapping01.c +4 -7
index 3b4f0a61a..f6133cc0d 100644
@@ -155,18 +155,15 @@ static void check_swapping(void)
 	SAFE_WAITPID(pid, &status, 0);
 }
 
-static void setup(void)
-{
-	if (access("/proc/swaps", F_OK))
-		tst_brk(TCONF, "swap not supported by kernel");
-}
-
 static struct tst_test test = {
 	.needs_root = 1,
 	.forks_child = 1,
 	.min_mem_avail = 10,
 	.test_all = test_swapping,
-	.setup = setup,
+	.needs_kconfigs = (const char *[]) {
+		"CONFIG_SWAP=y",
+		NULL
+	},
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "50a15981a1fa"},
 		{}
Signature · 5 lines
2.35.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp