Skip to contentSkip to conversation

lib-random32-convert-selftest-to-kunit.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Aug 4

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: lib/random32: convert selftest to KUnit
has been removed from the -mm tree. Its filename was
lib-random32-convert-selftest-to-kunit.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Kir Chou <[email protected]>
Subject: lib/random32: convert selftest to KUnit
Date: Fri, 3 Jul 2026 14:00:59 +0900

Convert the existing prandom selftest (lib/random32.c) to use the KUnit framework (lib/tests/random32_kunit.c). Unlike typical KUnit tests, this file is directly #included into lib/random32.c.

The new test:
- Removes the legacy CONFIG_RANDOM32_SELFTEST from lib/random32.c.
- Adds CONFIG_PRANDOM_KUNIT_TEST (defaulting to KUNIT_ALL_TESTS).
- Moves the test logic to lib/tests/random32_kunit.c.

This commit is verified by ./tools/testing/kunit/kunit.py run with the .kunit/.kunitconfig:

CONFIG_KUNIT=y
CONFIG_PRANDOM_KUNIT_TEST=y

Cc Brendan Higgins <[email protected]>
Cc David S. Miller <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Jakub Kacinski <[email protected]>
Cc Kuan-Wei Chiu <[email protected]>
Cc Paolo Abeni <[email protected]>
Cc Simon Horman <[email protected]>
Cc Thomas Weißschuh <[email protected]>

---

 lib/Kconfig                |    6 -
 lib/Kconfig.debug          |    9 +
 lib/random32.c             |  184 +----------------------------------
 lib/tests/Makefile         |    1 
 lib/tests/random32_kunit.c |  182 ++++++++++++++++++++++++++++++++++
 5 files changed, 202 insertions(+), 180 deletions(-)
lib/Kconfig renamed from lib/Kconfig~lib-random32-convert-selftest-to-kunit +0 -6
@@ -159,12 +159,6 @@ config AUDIT_COMPAT_GENERIC
 	depends on AUDIT_GENERIC && AUDIT_ARCH_COMPAT_GENERIC && COMPAT
 	default y
 
-config RANDOM32_SELFTEST
-	bool "PRNG perform self test on init"
-	help
-	  This option enables the 32 bit PRNG library functions to perform a
-	  self test on initialization.
-
 #
 # compression support is select'ed if needed
 #
lib/Kconfig.debug renamed from lib/Kconfig.debug~lib-random32-convert-selftest-to-kunit +9 -0
@@ -3520,6 +3520,15 @@ config GLOB_KUNIT_TEST
 
 	  If unsure, say N
 
+config PRANDOM_KUNIT_TEST
+	tristate "KUnit test for prandom" if !KUNIT_ALL_TESTS
+	depends on KUNIT
+	default KUNIT_ALL_TESTS
+	help
+	  Enable this option to test the prandom functions at runtime.
+
+	  If unsure, say N
+
 endif # RUNTIME_TESTING_MENU
 
 config ARCH_USE_MEMTEST
lib/random32.c renamed from lib/random32.c~lib-random32-convert-selftest-to-kunit +10 -174

205 lines not on this page · raw message

lib/tests/Makefile renamed from lib/tests/Makefile~lib-random32-convert-selftest-to-kunit +1 -0
@@ -43,6 +43,7 @@ CFLAGS_overflow_kunit.o = $(call cc-disa
 obj-$(CONFIG_OVERFLOW_KUNIT_TEST) += overflow_kunit.o
 # GCC < 12.1 can miscompile errptr() test when branch profiling is enabled.
 CFLAGS_printf_kunit.o += -DDISABLE_BRANCH_PROFILING
+obj-$(CONFIG_PRANDOM_KUNIT_TEST) += random32_kunit.o
 obj-$(CONFIG_PRINTF_KUNIT_TEST) += printf_kunit.o
 obj-$(CONFIG_RANDSTRUCT_KUNIT_TEST) += randstruct_kunit.o
 obj-$(CONFIG_SCANF_KUNIT_TEST) += scanf_kunit.o
lib/tests/random32_kunit.c new file +182 -0

182 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are