Skip to contentSkip to conversation

lib-math-add-kunit-test-suite-for-polynomial_calc.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/math: add KUnit test suite for polynomial_calc()
has been removed from the -mm tree. Its filename was
lib-math-add-kunit-test-suite-for-polynomial_calc.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: Adi Nata <[email protected]>
Subject: lib/math: add KUnit test suite for polynomial_calc()
Date: Sat, 6 Jun 2026 11:03:09 +0800

Add a KUnit test suite for the polynomial_calc() function, which had no in-kernel test coverage. The tests verify correct evaluation of constant, linear, quadratic, and cubic polynomials, including negative coefficients, negative input data, zero-coefficient terms.

The Kconfig entry uses 'select POLYNOMIAL' rather than 'depends on POLYNOMIAL' because POLYNOMIAL is a promptless tristate that cannot be manually enabled on UML without an explicit selector.

---

 lib/Kconfig.debug                 |   17 +
 lib/math/tests/Makefile           |    1 
 lib/math/tests/polynomial_kunit.c |  270 ++++++++++++++++++++++++++++
 3 files changed, 288 insertions(+)
lib/Kconfig.debug renamed from lib/Kconfig.debug~lib-math-add-kunit-test-suite-for-polynomial_calc +17 -0
@@ -3476,6 +3476,23 @@ config GCD_KUNIT_TEST
 
 	  If unsure, say N
 
+config POLYNOMIAL_KUNIT_TEST
+	tristate "Polynomial calculation (polynomial_calc) test" if !KUNIT_ALL_TESTS
+	depends on KUNIT
+	select POLYNOMIAL
+	default KUNIT_ALL_TESTS
+	help
+	  This option enables the KUnit test suite for the polynomial_calc()
+	  function, which evaluates integer polynomials using factor
+	  redistribution to avoid overflow.
+
+	  The test suite verifies correctness for constant, linear, and
+	  quadratic polynomials, negative coefficients, per-step dividers,
+	  divider_leftover, total_divider scaling, and a real sensor
+	  N-to-temperature conversion polynomial.
+
+	  If unsure, say N
+
 config PRIME_NUMBERS_KUNIT_TEST
 	tristate "Prime number generator test" if !KUNIT_ALL_TESTS
 	depends on KUNIT
lib/math/tests/Makefile renamed from lib/math/tests/Makefile~lib-math-add-kunit-test-suite-for-polynomial_calc +1 -0
@@ -4,5 +4,6 @@ obj-$(CONFIG_GCD_KUNIT_TEST)		+= gcd_kun
 obj-$(CONFIG_INT_LOG_KUNIT_TEST)	+= int_log_kunit.o
 obj-$(CONFIG_INT_POW_KUNIT_TEST)	+= int_pow_kunit.o
 obj-$(CONFIG_INT_SQRT_KUNIT_TEST)	+= int_sqrt_kunit.o
+obj-$(CONFIG_POLYNOMIAL_KUNIT_TEST)	+= polynomial_kunit.o
 obj-$(CONFIG_PRIME_NUMBERS_KUNIT_TEST)	+= prime_numbers_kunit.o
 obj-$(CONFIG_RATIONAL_KUNIT_TEST)	+= rational_kunit.o
lib/math/tests/polynomial_kunit.c new file +270 -0

270 lines not on this page · raw message

_

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