]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
lib/crc: tests: Add CRC_ENABLE_ALL_FOR_KUNIT
authorEric Biggers <ebiggers@kernel.org>
Fri, 6 Mar 2026 03:35:56 +0000 (19:35 -0800)
committerEric Biggers <ebiggers@kernel.org>
Mon, 9 Mar 2026 20:29:46 +0000 (13:29 -0700)
Now that crc_kunit uses the standard "depends on" pattern, enabling the
full set of CRC tests is a bit difficult, mainly due to CRC7 being
rarely used.  Add a kconfig option to make it easier.  It is visible
only when KUNIT, so hopefully the extra prompt won't be too annoying.

Link: https://lore.kernel.org/r/20260306033557.250499-3-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
lib/crc/Kconfig

index 9ddfd1a297576995e564d454f111036151b4bbf7..cca228879bb5a6800dcd723127ca685a07e9e3aa 100644 (file)
@@ -107,6 +107,20 @@ config CRC_KUNIT_TEST
          This is intended to help people writing architecture-specific
          optimized versions.  If unsure, say N.
 
+config CRC_ENABLE_ALL_FOR_KUNIT
+       tristate "Enable all CRC functions for KUnit test"
+       depends on KUNIT
+       select CRC7
+       select CRC16
+       select CRC_T10DIF
+       select CRC32
+       select CRC64
+       help
+         Enable all CRC functions that have test code in CRC_KUNIT_TEST.
+
+         Enable this only if you'd like the CRC KUnit test suite to test all
+         the CRC variants, even ones that wouldn't otherwise need to be built.
+
 config CRC_BENCHMARK
        bool "Benchmark for the CRC functions"
        depends on CRC_KUNIT_TEST