milos-linux/lib/crc
Eric Biggers cdb39c31c9 lib/crc: tests: Make crc_kunit test only the enabled CRC variants
commit 85c9f3a2b8 upstream.

Like commit 4478e8eeb8 ("lib/crypto: tests: Depend on library options
rather than selecting them") did with the crypto library tests, make
crc_kunit depend on the code it tests rather than selecting it.  This
follows the standard convention for KUnit and fixes an issue where
enabling KUNIT_ALL_TESTS enabled non-test code.

crc_kunit does differ from the crypto library tests in that it
consolidates the tests for multiple CRC variants, with 5 kconfig
options, into one KUnit suite.  Since depending on *all* of these
kconfig options would greatly restrict the ability to enable crc_kunit,
instead just depend on *any* of these options.  Update crc_kunit
accordingly to test only the reachable code.

Alternatively we could split crc_kunit into 5 test suites.  But keeping
it as one is simpler for now.

Fixes: e47d9b1a76 ("lib/crc_kunit.c: add KUnit test suite for CRC library functions")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20260306033557.250499-2-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-05-14 15:31:13 +02:00
..
arm lib/crc: Switch ARM and arm64 to 'ksimd' scoped guard API 2025-11-12 09:52:01 +01:00
arm64 lib/crc: Switch ARM and arm64 to 'ksimd' scoped guard API 2025-11-12 09:52:01 +01:00
loongarch lib/crc: Drop inline from all *_mod_init_arch() functions 2025-08-15 19:06:08 -07:00
mips lib/crc: Drop inline from all *_mod_init_arch() functions 2025-08-15 19:06:08 -07:00
powerpc lib/crc: Drop inline from all *_mod_init_arch() functions 2025-08-15 19:06:08 -07:00
riscv lib/crc: riscv: Migrate optimized CRC code into lib/crc/ 2025-06-30 09:31:57 -07:00
s390 lib/crc: s390: Migrate optimized CRC code into lib/crc/ 2025-06-30 09:31:57 -07:00
sparc lib/crc: Drop inline from all *_mod_init_arch() functions 2025-08-15 19:06:08 -07:00
tests lib/crc: tests: Make crc_kunit test only the enabled CRC variants 2026-05-14 15:31:13 +02:00
x86 lib/crc: Drop inline from all *_mod_init_arch() functions 2025-08-15 19:06:08 -07:00
.gitignore
crc-ccitt.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
crc-itu-t.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
crc-t10dif-main.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
crc4.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
crc7.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
crc8.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
crc16.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
crc32-main.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
crc64-main.c lib/crc: Explicitly include <linux/export.h> 2025-06-30 09:31:57 -07:00
gen_crc32table.c
gen_crc64table.c
Kconfig lib/crc: tests: Make crc_kunit test only the enabled CRC variants 2026-05-14 15:31:13 +02:00
Makefile lib/crc: x86: Migrate optimized CRC code into lib/crc/ 2025-06-30 09:31:57 -07:00