Lines Matching defs: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_first_and_bit(void *bitmap, const void *bitmap2, unsigned long len)
58 bitmap_copy(cp, bitmap, BITMAP_LEN);
71 static int __init test_find_next_bit(const void *bitmap, unsigned long len)
78 i = find_next_bit(bitmap, BITMAP_LEN, i) + 1;
85 static int __init test_find_next_zero_bit(const void *bitmap, unsigned long len)
92 i = find_next_zero_bit(bitmap, len, i) + 1;
99 static int __init test_find_last_bit(const void *bitmap, unsigned long len)
107 l = find_last_bit(bitmap, len);
118 static int __init test_find_nth_bit(const unsigned long *bitmap, unsigned long len)
120 unsigned long l, n, w = bitmap_weight(bitmap, len);
125 l = find_nth_bit(bitmap, len, n);
134 static int __init test_find_next_and_bit(const void *bitmap,
142 i = find_next_and_bit(bitmap, bitmap2, BITMAP_LEN, i + 1);
153 pr_err("\nStart testing find_bit() with random-filled bitmap\n");
155 get_random_bytes(bitmap, sizeof(bitmap));
158 test_find_next_bit(bitmap, BITMAP_LEN);
159 test_find_next_zero_bit(bitmap, BITMAP_LEN);
160 test_find_last_bit(bitmap, BITMAP_LEN);
161 test_find_nth_bit(bitmap, BITMAP_LEN / 10);
165 * traverse only part of bitmap to avoid soft lockup.
167 test_find_first_bit(bitmap, BITMAP_LEN / 10);
168 test_find_first_and_bit(bitmap, bitmap2, BITMAP_LEN / 2);
169 test_find_next_and_bit(bitmap, bitmap2, BITMAP_LEN);
171 pr_err("\nStart testing find_bit() with sparse bitmap\n");
173 bitmap_zero(bitmap, BITMAP_LEN);
177 __set_bit(get_random_u32_below(BITMAP_LEN), bitmap);
181 test_find_next_bit(bitmap, BITMAP_LEN);
182 test_find_next_zero_bit(bitmap, BITMAP_LEN);
183 test_find_last_bit(bitmap, BITMAP_LEN);
184 test_find_nth_bit(bitmap, BITMAP_LEN);
185 test_find_first_bit(bitmap, BITMAP_LEN);
186 test_find_first_and_bit(bitmap, bitmap2, BITMAP_LEN);
187 test_find_next_and_bit(bitmap, bitmap2, BITMAP_LEN);