]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
test_bits: add tests for __GENMASK() and __GENMASK_ULL()
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>
Mon, 9 Jun 2025 02:45:47 +0000 (11:45 +0900)
committerYury Norov <yury.norov@gmail.com>
Thu, 31 Jul 2025 15:28:03 +0000 (11:28 -0400)
commitdcb23e1878013dd04122122ed8eba35f354a091b
tree1bea0fd54e336b7296b4ca6f51ea47474be7b109
parent104ea1c84b91c9f452e497ba51602b903711cdd5
test_bits: add tests for __GENMASK() and __GENMASK_ULL()

The definitions of GENMASK() and GENMASK_ULL() do not depend any more
on __GENMASK() and __GENMASK_ULL(). Duplicate the existing unit tests
so that __GENMASK{,ULL}() are still covered.

Because __GENMASK() and __GENMASK_ULL() do use GENMASK_INPUT_CHECK(),
drop the TEST_GENMASK_FAILURES negative tests.

It would be good to have a small assembly test case for GENMASK*() in
case somebody decides to unify both in the future. However, I lack
expertise in assembly to do so. Instead add a FIXME message to
highlight the absence of the asm unit test.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
lib/tests/test_bits.c