[PATCH 04/16] lib/test_bitmap: test test_bitmap_arr{32,64} starting from nbits == 1

Yury Norov
2022-07-18T19:29:13Z

nbits == 0 is useless. In a real code it's most probably a sign of
error, and it makes CONFIG_DEBUG_BITMAP barking.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
lib/test_bitmap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c
index 2a70393ac011..bc48d992d10d 100644
--- a/lib/test_bitmap.c
+++ b/lib/test_bitmap.c
@@ -567,7 +567,7 @@ static void __init test_bitmap_arr32(void)

memset(arr, 0xa5, sizeof(arr));

- for (nbits = 0; nbits < EXP1_IN_BITS; ++nbits) {
+ for (nbits = 1; nbits < EXP1_IN_BITS; ++nbits) {
bitmap_to_arr32(arr, exp1, nbits);
bitmap_from_arr32(bmap2, arr, nbits);
expect_eq_bitmap(bmap2, exp1, nbits);
@@ -593,7 +593,7 @@ static void __init test_bitmap_arr64(void)

memset(arr, 0xa5, sizeof(arr));

- for (nbits = 0; nbits < EXP1_IN_BITS; ++nbits) {
+ for (nbits = 1; nbits < EXP1_IN_BITS; ++nbits) {
memset(bmap2, 0xff, sizeof(arr));
bitmap_to_arr64(arr, exp1, nbits);
bitmap_from_arr64(bmap2, arr, nbits);
--
2.34.1