aboutsummaryrefslogtreecommitdiff
path: root/lib/test_bitops.c
AgeCommit message (Collapse)AuthorFilesLines
2021-07-08lib/test: fix spelling mistakesZhen Lei1-1/+1
Fix some spelling mistakes in comments found by "codespell": thats ==> that's unitialized ==> uninitialized panicing ==> panicking sucess ==> success possitive ==> positive intepreted ==> interpreted Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Zhen Lei <[email protected]> Acked-by: Yonghong Song <[email protected]> [test_bfp.c] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2020-08-12lib/test_bitops: do the full test during module initGeert Uytterhoeven1-8/+10
Currently, the bitops test consists of two parts: one part is executed during module load, the second part during module unload. This is cumbersome for the user, as he has to perform two steps to execute all tests, and is different from most (all?) other tests. Merge the two parts, so both are executed during module load. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Cc: Wei Yang <[email protected]> Cc: Jesse Brandeburg <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
2020-06-10lib: test get_count_order/long in test_bitops.cWei Yang1-2/+51
Add some tests for get_count_order/long in test_bitops.c. [[email protected]: define local `i'] [[email protected]: enhancement, warning fix, cleanup per Geert] [[email protected]: fix loop bound, per Wei Yang] Signed-off-by: Wei Yang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Cc: Christian Brauner <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
2020-06-04lib: make a test module with set/clear bitJesse Brandeburg1-0/+60
Test some bit clears/sets to make sure assembly doesn't change, and that the set_bit and clear_bit functions work and don't cause sparse warnings. Instruct Kbuild to build this file with extra warning level -Wextra, to catch new issues, and also doesn't hurt to build with C=1. This was used to test changes to arch/x86/include/asm/bitops.h. In particular, sparse (C=1) was very concerned when the last bit before a natural boundary, like 7, or 31, was being tested, as this causes sign extension (0xffffff7f) for instance when clearing bit 7. Recommended usage: make defconfig scripts/config -m CONFIG_TEST_BITOPS make modules_prepare make C=1 W=1 lib/test_bitops.ko objdump -S -d lib/test_bitops.ko insmod lib/test_bitops.ko rmmod lib/test_bitops.ko <check dmesg>, there should be no compiler/sparse warnings and no error messages in log. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Jesse Brandeburg <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Cc: Thomas Gleixner <[email protected]> CcL Ingo Molnar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Rasmus Villemoes <[email protected]> Cc: Dan Williams <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Wei Yang <[email protected]> Cc: Christian Brauner <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>