[PATCH 03/16] lib/test_bitmap: don't test bitmap_set if nbits == 0

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

Don't test bitmap_set(bitmap, start, 0) as it's useless, most probably
a sign of error in real code, and makes CONFIG_DEBUG_BITMAP barking.

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

diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c
index 98754ff9fe68..2a70393ac011 100644
--- a/lib/test_bitmap.c
+++ b/lib/test_bitmap.c
@@ -622,7 +622,7 @@ static void noinline __init test_mem_optimisations(void)
unsigned int start, nbits;

for (start = 0; start < 1024; start += 8) {
- for (nbits = 0; nbits < 1024 - start; nbits += 8) {
+ for (nbits = 1; nbits < 1024 - start; nbits += 8) {
memset(bmap1, 0x5a, sizeof(bmap1));
memset(bmap2, 0x5a, sizeof(bmap2));

--
2.34.1