Lines Matching refs:bitmap

14  * - randomly filled bitmap with approximately equal number of set and
16 * - sparse bitmap with few set bits at random positions.
29 static DECLARE_BITMAP(bitmap, BITMAP_LEN) __initdata;
34 * all other tests for the same bitmap because it sets all bits of bitmap to 1.
36 static int __init test_find_first_bit(void *bitmap, unsigned long len)
43 i = find_first_bit(bitmap, len);
44 __clear_bit(i, bitmap);
52 static int __init test_find_next_bit(const void *bitmap, unsigned long len)
59 i = find_next_bit(bitmap, BITMAP_LEN, i) + 1;
66 static int __init test_find_next_zero_bit(const void *bitmap, unsigned long len)
73 i = find_next_zero_bit(bitmap, len, i) + 1;
80 static int __init test_find_last_bit(const void *bitmap, unsigned long len)
88 l = find_last_bit(bitmap, len);
99 static int __init test_find_next_and_bit(const void *bitmap,
107 i = find_next_and_bit(bitmap, bitmap2, BITMAP_LEN, i + 1);
118 pr_err("\nStart testing find_bit() with random-filled bitmap\n");
120 get_random_bytes(bitmap, sizeof(bitmap));
123 test_find_next_bit(bitmap, BITMAP_LEN);
124 test_find_next_zero_bit(bitmap, BITMAP_LEN);
125 test_find_last_bit(bitmap, BITMAP_LEN);
129 * traverse only part of bitmap to avoid soft lockup.
131 test_find_first_bit(bitmap, BITMAP_LEN / 10);
132 test_find_next_and_bit(bitmap, bitmap2, BITMAP_LEN);
134 pr_err("\nStart testing find_bit() with sparse bitmap\n");
136 bitmap_zero(bitmap, BITMAP_LEN);
140 __set_bit(prandom_u32() % BITMAP_LEN, bitmap);
144 test_find_next_bit(bitmap, BITMAP_LEN);
145 test_find_next_zero_bit(bitmap, BITMAP_LEN);
146 test_find_last_bit(bitmap, BITMAP_LEN);
147 test_find_first_bit(bitmap, BITMAP_LEN);
148 test_find_next_and_bit(bitmap, bitmap2, BITMAP_LEN);