]> git.baikalelectronics.ru Git - kernel.git/commit
bitfield: add tests
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 20 Jun 2018 06:58:30 +0000 (08:58 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 27 Jun 2018 15:58:49 +0000 (18:58 +0300)
commitc8919dca2eb120c003f789173a3fff13da38fbbf
tree58ea25d9c8ffb3fbc407ffce77823dccbc020af2
parent813fde5605f82a9fafbb14c2b28f8498d37bf93d
bitfield: add tests

Add tests for the bitfield helpers. The constant ones will all
be folded to nothing by the compiler (if everything is correct
in the header file), and the variable ones do some tests against
open-coding the necessary shifts.

A few test cases that should fail/warn compilation are provided
under ifdef.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
lib/Kconfig.debug
lib/Makefile
lib/test_bitfield.c [new file with mode: 0644]