Lines Matching refs:nbits

77 		  unsigned int nbits)  in __check_eq_bitmap()  argument
79 if (!bitmap_equal(exp_bmap, bmap, nbits)) { in __check_eq_bitmap()
82 nbits, exp_bmap, nbits, bmap); in __check_eq_bitmap()
91 const unsigned long *bitmap, unsigned int nbits) in __check_eq_pbl() argument
93 snprintf(pbl_buffer, sizeof(pbl_buffer), "%*pbl", nbits, bitmap); in __check_eq_pbl()
360 unsigned int nbits = 64; in test_replace() local
361 unsigned int nlongs = DIV_ROUND_UP(nbits, BITS_PER_LONG); in test_replace()
364 BUILD_BUG_ON(EXP2_IN_BITS < nbits * 2); in test_replace()
367 bitmap_replace(bmap, &exp2[0 * nlongs], &exp2[1 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
368 expect_eq_bitmap(bmap, exp3_0_1, nbits); in test_replace()
371 bitmap_replace(bmap, &exp2[1 * nlongs], &exp2[0 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
372 expect_eq_bitmap(bmap, exp3_1_0, nbits); in test_replace()
375 bitmap_replace(bmap, &exp2[0 * nlongs], &exp2[1 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
376 expect_eq_bitmap(bmap, exp3_0_1, nbits); in test_replace()
379 bitmap_replace(bmap, &exp2[1 * nlongs], &exp2[0 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
380 expect_eq_bitmap(bmap, exp3_1_0, nbits); in test_replace()
401 unsigned int nbits = 64; in test_bitmap_sg() local
409 bitmap_gather(bmap_gather, sg_src, sg_mask, nbits); in test_bitmap_sg()
410 expect_eq_bitmap(sg_gather_exp, bmap_gather, nbits); in test_bitmap_sg()
414 bitmap_scatter(bmap_scatter, sg_src, sg_mask, nbits); in test_bitmap_sg()
415 expect_eq_bitmap(sg_scatter_exp, bmap_scatter, nbits); in test_bitmap_sg()
419 bitmap_gather(bmap_tmp, bmap_scatter, sg_mask, nbits); in test_bitmap_sg()
420 bitmap_scatter(bmap_res, bmap_tmp, sg_mask, nbits); in test_bitmap_sg()
421 expect_eq_bitmap(bmap_scatter, bmap_res, nbits); in test_bitmap_sg()
431 const int nbits; member
531 err = bitmap_parselist(ptest.in, bmap, ptest.nbits); in test_bitmap_parselist()
542 && !__bitmap_equal(bmap, ptest.expected, ptest.nbits)) { in test_bitmap_parselist()
648 err = bitmap_parse(test.in, len, bmap, test.nbits); in test_bitmap_parse()
659 && !__bitmap_equal(bmap, test.expected, test.nbits)) { in test_bitmap_parse()
675 unsigned int nbits, next_bit; in test_bitmap_arr32() local
681 for (nbits = 0; nbits < EXP1_IN_BITS; ++nbits) { in test_bitmap_arr32()
682 bitmap_to_arr32(arr, exp1, nbits); in test_bitmap_arr32()
683 bitmap_from_arr32(bmap2, arr, nbits); in test_bitmap_arr32()
684 expect_eq_bitmap(bmap2, exp1, nbits); in test_bitmap_arr32()
687 round_up(nbits, BITS_PER_LONG), nbits); in test_bitmap_arr32()
688 if (next_bit < round_up(nbits, BITS_PER_LONG)) { in test_bitmap_arr32()
691 nbits, next_bit); in test_bitmap_arr32()
695 if (nbits < EXP1_IN_BITS - 32) in test_bitmap_arr32()
696 expect_eq_uint(arr[DIV_ROUND_UP(nbits, 32)], in test_bitmap_arr32()
703 unsigned int nbits, next_bit; in test_bitmap_arr64() local
709 for (nbits = 0; nbits < EXP1_IN_BITS; ++nbits) { in test_bitmap_arr64()
711 bitmap_to_arr64(arr, exp1, nbits); in test_bitmap_arr64()
712 bitmap_from_arr64(bmap2, arr, nbits); in test_bitmap_arr64()
713 expect_eq_bitmap(bmap2, exp1, nbits); in test_bitmap_arr64()
715 next_bit = find_next_bit(bmap2, round_up(nbits, BITS_PER_LONG), nbits); in test_bitmap_arr64()
716 if (next_bit < round_up(nbits, BITS_PER_LONG)) { in test_bitmap_arr64()
718 " tail is not safely cleared: %d\n", nbits, next_bit); in test_bitmap_arr64()
722 if ((nbits % 64) && in test_bitmap_arr64()
723 (arr[(nbits - 1) / 64] & ~GENMASK_ULL((nbits - 1) % 64, 0))) { in test_bitmap_arr64()
725 nbits, arr[(nbits - 1) / 64], in test_bitmap_arr64()
726 GENMASK_ULL((nbits - 1) % 64, 0)); in test_bitmap_arr64()
730 if (nbits < EXP1_IN_BITS - 64) in test_bitmap_arr64()
731 expect_eq_uint(arr[DIV_ROUND_UP(nbits, 64)], 0xa5a5a5a5); in test_bitmap_arr64()
739 unsigned int start, nbits; in test_mem_optimisations() local
742 for (nbits = 0; nbits < 1024 - start; nbits += 8) { in test_mem_optimisations()
746 bitmap_set(bmap1, start, nbits); in test_mem_optimisations()
747 __bitmap_set(bmap2, start, nbits); in test_mem_optimisations()
749 printk("set not equal %d %d\n", start, nbits); in test_mem_optimisations()
753 printk("set not __equal %d %d\n", start, nbits); in test_mem_optimisations()
757 bitmap_clear(bmap1, start, nbits); in test_mem_optimisations()
758 __bitmap_clear(bmap2, start, nbits); in test_mem_optimisations()
760 printk("clear not equal %d %d\n", start, nbits); in test_mem_optimisations()
765 nbits); in test_mem_optimisations()
1041 unsigned int nbits; member
1089 bitmap_cut(out, in, t->first, t->cut, t->nbits); in test_bitmap_cut()
1091 expect_eq_bitmap(t->expected, out, t->nbits); in test_bitmap_cut()
1097 unsigned long nbits; member
1208 n = bitmap_print_bitmask_to_buf(print_buf, t->bitmap, t->nbits, in test_bitmap_print_buf()
1213 n = bitmap_print_list_to_buf(print_buf, t->bitmap, t->nbits, in test_bitmap_print_buf()
1220 n = bitmap_print_list_to_buf(print_buf, t->bitmap, t->nbits, in test_bitmap_print_buf()
1306 int i, n, nbits; in test_bitmap_write_helper() local
1337 for (nbits = BITS_PER_LONG; nbits >= 1; nbits--) { in test_bitmap_write_helper()
1340 w >>= (BITS_PER_LONG - nbits); in test_bitmap_write_helper()
1341 for (i = 0; i <= TEST_BIT_LEN - nbits; i++) { in test_bitmap_write_helper()
1344 for (n = 0; n < nbits; n++) in test_bitmap_write_helper()
1346 bitmap_write(bitmap, w, i, nbits); in test_bitmap_write_helper()
1348 r = bitmap_read(bitmap, i, nbits); in test_bitmap_write_helper()
1406 unsigned int cnt, nbits, i; in test_bitmap_read_perf() local
1413 for (nbits = 1; nbits <= BITS_PER_LONG; nbits++) { in test_bitmap_read_perf()
1415 if (i + nbits > TEST_BIT_LEN) in test_bitmap_read_perf()
1421 WRITE_ONCE(val, bitmap_read(bitmap, i, nbits)); in test_bitmap_read_perf()
1432 unsigned int cnt, nbits, i; in test_bitmap_write_perf() local
1439 for (nbits = 1; nbits <= BITS_PER_LONG; nbits++) { in test_bitmap_write_perf()
1441 if (i + nbits > TEST_BIT_LEN) in test_bitmap_write_perf()
1443 bitmap_write(bitmap, val, i, nbits); in test_bitmap_write_perf()