2 #include <linux/compiler.h> 3 #include <linux/bitmap.h> 13 unsigned long *bm = NULL;
16 bm = bitmap_alloc(nbits);
19 bitmap_zero(bm, nbits);
21 for (i = 0; i < map->
nr; i++)
22 set_bit(map->
map[i], bm);
36 bitmap_scnprintf(bm,
NBITS, buf,
sizeof(buf));
39 ret = !strcmp(buf, str);
48 TEST_ASSERT_VAL(
"failed to convert map",
test_bitmap(
"1,3,5,7,9,11,13,15,17,19,21-40"));
#define TEST_ASSERT_VAL(text, cond)
static unsigned long * get_bitmap(const char *str, int nbits)
static int test_bitmap(const char *str)
void cpu_map__put(struct cpu_map *map)
#define pr_debug(fmt,...)
int test__bitmap_print(struct test *test __maybe_unused, int subtest __maybe_unused)
static int str(yyscan_t scanner, int token)
struct cpu_map * cpu_map__new(const char *cpu_list)