Skip to contentSkip to conversation

s390: fix dead defaults for S390_MODULES_SANITY_TEST and S390_UNWIND_SELFTEST

PATCH In review Julian Braha 2 participants 2 messages May 9 – May 11 s390

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 s390: fix dead defaults for S390_MODULES_SANITY_TEST and S390_UNWIND_SELFTEST

These config options currently have unconditional defaults of 'n' from the def_tristate statement, which shadow the later default of 'KUNIT_ALL_TESTS', causing it to be dead code.

It looks to me like the commit 25d36a85c61b ("s390/test_unwind: convert to KUnit") added the KUNIT_ALL_TESTS default to S390_UNWIND_SELFTEST, but mistakenly didn't remove the previous 'n' default.

Then, the later commit 90c5318795ee ("s390/module: test loading modules with a lot of relocations") copied the Kconfig layout from S390_UNWIND_SELFTEST when adding the S390_MODULES_SANITY_TEST config option, without noticing the existing mistake.

This dead code was found by kconfirm, a static analysis tool for Kconfig.

---
v2: remove Fixes tags
Link to v1: https://lore.kernel.org/all/[email protected]/

---
 arch/s390/Kconfig | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
arch/s390/Kconfig +2 -4
index ecbcbb781e40..4bd1023a45a3 100644
@@ -999,9 +999,8 @@ config S390_MODULES_SANITY_TEST_HELPERS
 menu "Selftests"
 
 config S390_UNWIND_SELFTEST
-	def_tristate n
+	def_tristate KUNIT_ALL_TESTS
 	depends on KUNIT
-	default KUNIT_ALL_TESTS
 	prompt "Test unwind functions"
 	help
 	  This option enables s390 specific stack unwinder testing kernel
@@ -1023,9 +1022,8 @@ config S390_KPROBES_SANITY_TEST
 	  Say N if you are unsure.
 
 config S390_MODULES_SANITY_TEST
-	def_tristate n
+	def_tristate KUNIT_ALL_TESTS
 	depends on KUNIT && m
-	default KUNIT_ALL_TESTS
 	prompt "Enable s390 specific modules tests"
 	select S390_MODULES_SANITY_TEST_HELPERS
 	help
Signature · 1 line
2.53.0
#1 lore raw
Quoted 3 lines · Julian Braha

These config options currently have unconditional defaults of 'n' from the def_tristate statement, which shadow the later default of 'KUNIT_ALL_TESTS', causing it to be dead code.

Please, note that it is Kconfig Language dead code, not kernel one.

Quoted 7 lines

It looks to me like the commit 25d36a85c61b ("s390/test_unwind: convert to KUnit") added the KUNIT_ALL_TESTS default to S390_UNWIND_SELFTEST, but mistakenly didn't remove the previous 'n' default.

Then, the later commit 90c5318795ee ("s390/module: test loading modules with a lot of relocations") copied the Kconfig layout from S390_UNWIND_SELFTEST when adding the S390_MODULES_SANITY_TEST config option, without noticing the existing mistake.

Please, paraphrase the above paragraphs in imperative and honour the line lengths.

Also, please add this patch and adjust the commit message so it looks like a s390 selftests config cleanup.

[PATCH] "s390: include S390_KPROBES_SANITY_TEST with KUNIT_ALL_TESTS"
https://lore.kernel.org/linux-s390/[email protected]/

Quoted 6 lines

This dead code was found by kconfirm, a static analysis tool for Kconfig.

---
v2: remove Fixes tags
Link to v1: https://lore.kernel.org/all/[email protected]/

Thanks!