Skip to content

Commit

Permalink
lib/test_bitmap: move exp1 and exp2 upper for others to use
Browse files Browse the repository at this point in the history
Some test cases may re-use predefined exp1 and exp2 bitmaps.  Move them
upper in the file.

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 0ee312e commit c21dd8a
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions lib/test_bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@ static unsigned failed_tests __initdata;

static char pbl_buffer[PAGE_SIZE] __initdata;

static const unsigned long exp1[] __initconst = {
BITMAP_FROM_U64(1),
BITMAP_FROM_U64(2),
BITMAP_FROM_U64(0x0000ffff),
BITMAP_FROM_U64(0xffff0000),
BITMAP_FROM_U64(0x55555555),
BITMAP_FROM_U64(0xaaaaaaaa),
BITMAP_FROM_U64(0x11111111),
BITMAP_FROM_U64(0x22222222),
BITMAP_FROM_U64(0xffffffff),
BITMAP_FROM_U64(0xfffffffe),
BITMAP_FROM_U64(0x3333333311111111ULL),
BITMAP_FROM_U64(0xffffffff77777777ULL),
BITMAP_FROM_U64(0),
};

static const unsigned long exp2[] __initconst = {
BITMAP_FROM_U64(0x3333333311111111ULL),
BITMAP_FROM_U64(0xffffffff77777777ULL),
};

static bool __init
__check_eq_uint(const char *srcfile, unsigned int line,
Expand Down Expand Up @@ -247,27 +267,6 @@ struct test_bitmap_parselist{
const int flags;
};

static const unsigned long exp1[] __initconst = {
BITMAP_FROM_U64(1),
BITMAP_FROM_U64(2),
BITMAP_FROM_U64(0x0000ffff),
BITMAP_FROM_U64(0xffff0000),
BITMAP_FROM_U64(0x55555555),
BITMAP_FROM_U64(0xaaaaaaaa),
BITMAP_FROM_U64(0x11111111),
BITMAP_FROM_U64(0x22222222),
BITMAP_FROM_U64(0xffffffff),
BITMAP_FROM_U64(0xfffffffe),
BITMAP_FROM_U64(0x3333333311111111ULL),
BITMAP_FROM_U64(0xffffffff77777777ULL),
BITMAP_FROM_U64(0),
};

static const unsigned long exp2[] __initconst = {
BITMAP_FROM_U64(0x3333333311111111ULL),
BITMAP_FROM_U64(0xffffffff77777777ULL)
};

static const struct test_bitmap_parselist parselist_tests[] __initconst = {
#define step (sizeof(u64) / sizeof(unsigned long))

Expand Down

0 comments on commit c21dd8a

Please sign in to comment.