Lines Matching refs:bmap

77 		  const unsigned long *exp_bmap, const unsigned long *bmap,  in __check_eq_bitmap()  argument
80 if (!bitmap_equal(exp_bmap, bmap, nbits)) { in __check_eq_bitmap()
83 nbits, exp_bmap, nbits, bmap); in __check_eq_bitmap()
197 DECLARE_BITMAP(bmap, 1024); in test_zero_clear()
200 memset(bmap, 0xff, 128); in test_zero_clear()
202 expect_eq_pbl("0-22", bmap, 23); in test_zero_clear()
203 expect_eq_pbl("0-1023", bmap, 1024); in test_zero_clear()
206 bitmap_clear(bmap, 0, 9); in test_zero_clear()
207 expect_eq_pbl("9-1023", bmap, 1024); in test_zero_clear()
209 bitmap_zero(bmap, 35); in test_zero_clear()
210 expect_eq_pbl("64-1023", bmap, 1024); in test_zero_clear()
213 bitmap_clear(bmap, 79, 19); in test_zero_clear()
214 expect_eq_pbl("64-78,98-1023", bmap, 1024); in test_zero_clear()
216 bitmap_zero(bmap, 115); in test_zero_clear()
217 expect_eq_pbl("128-1023", bmap, 1024); in test_zero_clear()
220 bitmap_zero(bmap, 1024); in test_zero_clear()
221 expect_eq_pbl("", bmap, 1024); in test_zero_clear()
227 DECLARE_BITMAP(bmap, 64 * 3); in test_find_nth_bit()
229 bitmap_zero(bmap, 64 * 3); in test_find_nth_bit()
230 __set_bit(10, bmap); in test_find_nth_bit()
231 __set_bit(20, bmap); in test_find_nth_bit()
232 __set_bit(30, bmap); in test_find_nth_bit()
233 __set_bit(40, bmap); in test_find_nth_bit()
234 __set_bit(50, bmap); in test_find_nth_bit()
235 __set_bit(60, bmap); in test_find_nth_bit()
236 __set_bit(80, bmap); in test_find_nth_bit()
237 __set_bit(123, bmap); in test_find_nth_bit()
239 expect_eq_uint(10, find_nth_bit(bmap, 64 * 3, 0)); in test_find_nth_bit()
240 expect_eq_uint(20, find_nth_bit(bmap, 64 * 3, 1)); in test_find_nth_bit()
241 expect_eq_uint(30, find_nth_bit(bmap, 64 * 3, 2)); in test_find_nth_bit()
242 expect_eq_uint(40, find_nth_bit(bmap, 64 * 3, 3)); in test_find_nth_bit()
243 expect_eq_uint(50, find_nth_bit(bmap, 64 * 3, 4)); in test_find_nth_bit()
244 expect_eq_uint(60, find_nth_bit(bmap, 64 * 3, 5)); in test_find_nth_bit()
245 expect_eq_uint(80, find_nth_bit(bmap, 64 * 3, 6)); in test_find_nth_bit()
246 expect_eq_uint(123, find_nth_bit(bmap, 64 * 3, 7)); in test_find_nth_bit()
247 expect_eq_uint(64 * 3, find_nth_bit(bmap, 64 * 3, 8)); in test_find_nth_bit()
249 expect_eq_uint(10, find_nth_bit(bmap, 64 * 3 - 1, 0)); in test_find_nth_bit()
250 expect_eq_uint(20, find_nth_bit(bmap, 64 * 3 - 1, 1)); in test_find_nth_bit()
251 expect_eq_uint(30, find_nth_bit(bmap, 64 * 3 - 1, 2)); in test_find_nth_bit()
252 expect_eq_uint(40, find_nth_bit(bmap, 64 * 3 - 1, 3)); in test_find_nth_bit()
253 expect_eq_uint(50, find_nth_bit(bmap, 64 * 3 - 1, 4)); in test_find_nth_bit()
254 expect_eq_uint(60, find_nth_bit(bmap, 64 * 3 - 1, 5)); in test_find_nth_bit()
255 expect_eq_uint(80, find_nth_bit(bmap, 64 * 3 - 1, 6)); in test_find_nth_bit()
256 expect_eq_uint(123, find_nth_bit(bmap, 64 * 3 - 1, 7)); in test_find_nth_bit()
257 expect_eq_uint(64 * 3 - 1, find_nth_bit(bmap, 64 * 3 - 1, 8)); in test_find_nth_bit()
267 DECLARE_BITMAP(bmap, 1024); in test_fill_set()
270 memset(bmap, 0x00, 128); in test_fill_set()
272 expect_eq_pbl("", bmap, 23); in test_fill_set()
273 expect_eq_pbl("", bmap, 1024); in test_fill_set()
276 bitmap_set(bmap, 0, 9); in test_fill_set()
277 expect_eq_pbl("0-8", bmap, 1024); in test_fill_set()
279 bitmap_fill(bmap, 35); in test_fill_set()
280 expect_eq_pbl("0-63", bmap, 1024); in test_fill_set()
283 bitmap_set(bmap, 79, 19); in test_fill_set()
284 expect_eq_pbl("0-63,79-97", bmap, 1024); in test_fill_set()
286 bitmap_fill(bmap, 115); in test_fill_set()
287 expect_eq_pbl("0-127", bmap, 1024); in test_fill_set()
290 bitmap_fill(bmap, 1024); in test_fill_set()
291 expect_eq_pbl("0-1023", bmap, 1024); in test_fill_set()
339 DECLARE_BITMAP(bmap, 1024); in test_replace()
343 bitmap_zero(bmap, 1024); in test_replace()
344 bitmap_replace(bmap, &exp2[0 * nlongs], &exp2[1 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
345 expect_eq_bitmap(bmap, exp3_0_1, nbits); in test_replace()
347 bitmap_zero(bmap, 1024); in test_replace()
348 bitmap_replace(bmap, &exp2[1 * nlongs], &exp2[0 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
349 expect_eq_bitmap(bmap, exp3_1_0, nbits); in test_replace()
351 bitmap_fill(bmap, 1024); in test_replace()
352 bitmap_replace(bmap, &exp2[0 * nlongs], &exp2[1 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
353 expect_eq_bitmap(bmap, exp3_0_1, nbits); in test_replace()
355 bitmap_fill(bmap, 1024); in test_replace()
356 bitmap_replace(bmap, &exp2[1 * nlongs], &exp2[0 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
357 expect_eq_bitmap(bmap, exp3_1_0, nbits); in test_replace()
461 DECLARE_BITMAP(bmap, 2048); in test_bitmap_parselist()
467 err = bitmap_parselist(ptest.in, bmap, ptest.nbits); in test_bitmap_parselist()
478 && !__bitmap_equal(bmap, ptest.expected, ptest.nbits)) { in test_bitmap_parselist()
480 i, ptest.in, bmap[0], in test_bitmap_parselist()
496 unsigned long *bmap = kmalloc(PAGE_SIZE, GFP_KERNEL); in test_bitmap_printlist() local
502 if (!buf || !bmap) in test_bitmap_printlist()
505 memset(bmap, -1, PAGE_SIZE); in test_bitmap_printlist()
511 ret = bitmap_print_to_pagebuf(true, buf, bmap, PAGE_SIZE * 8); in test_bitmap_printlist()
529 kfree(bmap); in test_bitmap_printlist()
577 DECLARE_BITMAP(bmap, 2048); in test_bitmap_parse()
584 err = bitmap_parse(test.in, len, bmap, test.nbits); in test_bitmap_parse()
595 && !__bitmap_equal(bmap, test.expected, test.nbits)) { in test_bitmap_parse()
597 i, test.in, bmap[0], in test_bitmap_parse()