Skip to content

Commit

Permalink
lib/test_bitmap: name EXP_BYTES properly
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Andy Shevchenko <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Cc: William Breathitt Gray <[email protected]>
Cc: Yury Norov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
andy-shev authored and torvalds committed Dec 5, 2019
1 parent 5422404 commit a4881d1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/test_bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,17 +374,17 @@ static void __init test_bitmap_parselist_user(void)
__test_bitmap_parselist(1);
}

#define EXP_BYTES (sizeof(exp) * 8)
#define EXP1_IN_BITS (sizeof(exp) * 8)

static void __init test_bitmap_arr32(void)
{
unsigned int nbits, next_bit;
u32 arr[sizeof(exp) / 4];
DECLARE_BITMAP(bmap2, EXP_BYTES);
u32 arr[EXP1_IN_BITS / 32];
DECLARE_BITMAP(bmap2, EXP1_IN_BITS);

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

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

if (nbits < EXP_BYTES - 32)
if (nbits < EXP1_IN_BITS - 32)
expect_eq_uint(arr[DIV_ROUND_UP(nbits, 32)],
0xa5a5a5a5);
}
Expand Down

0 comments on commit a4881d1

Please sign in to comment.