Skip to content

Commit a4881d1

Browse files
andy-shevtorvalds
authored andcommitted
lib/test_bitmap: name EXP_BYTES properly
EXP_BYTES has been wrongly named. It's a size of the exp array in bits. While here, go ahead and rename to EXP1_IN_BITS to avoid double renaming when exp will be renamed to exp1 in the next patch Link: http://lkml.kernel.org/r/20191022172922.61232-4-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: William Breathitt Gray <vilhelm.gray@gmail.com> Cc: Yury Norov <yury.norov@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5422404 commit a4881d1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/test_bitmap.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,17 +374,17 @@ static void __init test_bitmap_parselist_user(void)
374374
__test_bitmap_parselist(1);
375375
}
376376

377-
#define EXP_BYTES (sizeof(exp) * 8)
377+
#define EXP1_IN_BITS (sizeof(exp) * 8)
378378

379379
static void __init test_bitmap_arr32(void)
380380
{
381381
unsigned int nbits, next_bit;
382-
u32 arr[sizeof(exp) / 4];
383-
DECLARE_BITMAP(bmap2, EXP_BYTES);
382+
u32 arr[EXP1_IN_BITS / 32];
383+
DECLARE_BITMAP(bmap2, EXP1_IN_BITS);
384384

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

387-
for (nbits = 0; nbits < EXP_BYTES; ++nbits) {
387+
for (nbits = 0; nbits < EXP1_IN_BITS; ++nbits) {
388388
bitmap_to_arr32(arr, exp, nbits);
389389
bitmap_from_arr32(bmap2, arr, nbits);
390390
expect_eq_bitmap(bmap2, exp, nbits);
@@ -396,7 +396,7 @@ static void __init test_bitmap_arr32(void)
396396
" tail is not safely cleared: %d\n",
397397
nbits, next_bit);
398398

399-
if (nbits < EXP_BYTES - 32)
399+
if (nbits < EXP1_IN_BITS - 32)
400400
expect_eq_uint(arr[DIV_ROUND_UP(nbits, 32)],
401401
0xa5a5a5a5);
402402
}

0 commit comments

Comments
 (0)