From 6d511020e13d5d6f5f0af853e32ddef75c693ccc Mon Sep 17 00:00:00 2001 From: Rikard Falkeborn Date: Tue, 11 Aug 2020 18:35:03 -0700 Subject: lib/test_bits.c: add tests of GENMASK Add tests of GENMASK and GENMASK_ULL. A few test cases that should fail compilation are provided under #ifdef TEST_GENMASK_FAILURES [rd.dunlap@gmail.com: add MODULE_LICENSE()] Link: http://lkml.kernel.org/r/dfc74524-0789-2827-4eff-476ddab65699@gmail.com [weiyongjun1@huawei.com: make some functions static] Link: http://lkml.kernel.org/r/20200702150336.4756-1-weiyongjun1@huawei.com Suggested-by: Andy Shevchenko Signed-off-by: Rikard Falkeborn Signed-off-by: Randy Dunlap Signed-off-by: Wei Yongjun Signed-off-by: Andrew Morton Reviewed-by: Andy Shevchenko Acked-by: William Breathitt Gray Cc: Emil Velikov Cc: Syed Nayyar Waris Cc: Andy Shevchenko Cc: Arnd Bergmann Cc: Geert Uytterhoeven Cc: Kees Cook Cc: Linus Walleij Cc: Masahiro Yamada Link: http://lkml.kernel.org/r/20200621054210.14804-2-rikard.falkeborn@gmail.com Link: http://lkml.kernel.org/r/20200608221823.35799-2-rikard.falkeborn@gmail.com Signed-off-by: Linus Torvalds --- lib/Kconfig.debug | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/Kconfig.debug') diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 5c5fbcb34af4..9ca1b11af1f6 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -2236,6 +2236,17 @@ config LINEAR_RANGES_TEST If unsure, say N. +config BITS_TEST + tristate "KUnit test for bits.h" + depends on KUNIT + help + This builds the bits unit test. + Tests the logic of macros defined in bits.h. + For more information on KUnit and unit tests in general please refer + to the KUnit documentation in Documentation/dev-tools/kunit/. + + If unsure, say N. + config TEST_UDELAY tristate "udelay test driver" help -- cgit v1.2.3