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()
332 unsigned int nbits = 64; in test_replace() local
333 unsigned int nlongs = DIV_ROUND_UP(nbits, BITS_PER_LONG); in test_replace()
336 BUILD_BUG_ON(EXP2_IN_BITS < nbits * 2); in test_replace()
339 bitmap_replace(bmap, &exp2[0 * nlongs], &exp2[1 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
340 expect_eq_bitmap(bmap, exp3_0_1, nbits); in test_replace()
343 bitmap_replace(bmap, &exp2[1 * nlongs], &exp2[0 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
344 expect_eq_bitmap(bmap, exp3_1_0, nbits); in test_replace()
347 bitmap_replace(bmap, &exp2[0 * nlongs], &exp2[1 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
348 expect_eq_bitmap(bmap, exp3_0_1, nbits); in test_replace()
351 bitmap_replace(bmap, &exp2[1 * nlongs], &exp2[0 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
352 expect_eq_bitmap(bmap, exp3_1_0, nbits); in test_replace()
373 unsigned int nbits = 64; in test_bitmap_sg() local
381 bitmap_gather(bmap_gather, sg_src, sg_mask, nbits); in test_bitmap_sg()
382 expect_eq_bitmap(sg_gather_exp, bmap_gather, nbits); in test_bitmap_sg()
386 bitmap_scatter(bmap_scatter, sg_src, sg_mask, nbits); in test_bitmap_sg()
387 expect_eq_bitmap(sg_scatter_exp, bmap_scatter, nbits); in test_bitmap_sg()
391 bitmap_gather(bmap_tmp, bmap_scatter, sg_mask, nbits); in test_bitmap_sg()
392 bitmap_scatter(bmap_res, bmap_tmp, sg_mask, nbits); in test_bitmap_sg()
393 expect_eq_bitmap(bmap_scatter, bmap_res, nbits); in test_bitmap_sg()
403 const int nbits; member
503 err = bitmap_parselist(ptest.in, bmap, ptest.nbits); in test_bitmap_parselist()
514 && !__bitmap_equal(bmap, ptest.expected, ptest.nbits)) { in test_bitmap_parselist()
620 err = bitmap_parse(test.in, len, bmap, test.nbits); in test_bitmap_parse()
631 && !__bitmap_equal(bmap, test.expected, test.nbits)) { in test_bitmap_parse()
647 unsigned int nbits, next_bit; in test_bitmap_arr32() local
653 for (nbits = 0; nbits < EXP1_IN_BITS; ++nbits) { in test_bitmap_arr32()
654 bitmap_to_arr32(arr, exp1, nbits); in test_bitmap_arr32()
655 bitmap_from_arr32(bmap2, arr, nbits); in test_bitmap_arr32()
656 expect_eq_bitmap(bmap2, exp1, nbits); in test_bitmap_arr32()
659 round_up(nbits, BITS_PER_LONG), nbits); in test_bitmap_arr32()
660 if (next_bit < round_up(nbits, BITS_PER_LONG)) { in test_bitmap_arr32()
663 nbits, next_bit); in test_bitmap_arr32()
667 if (nbits < EXP1_IN_BITS - 32) in test_bitmap_arr32()
668 expect_eq_uint(arr[DIV_ROUND_UP(nbits, 32)], in test_bitmap_arr32()
675 unsigned int nbits, next_bit; in test_bitmap_arr64() local
681 for (nbits = 0; nbits < EXP1_IN_BITS; ++nbits) { in test_bitmap_arr64()
683 bitmap_to_arr64(arr, exp1, nbits); in test_bitmap_arr64()
684 bitmap_from_arr64(bmap2, arr, nbits); in test_bitmap_arr64()
685 expect_eq_bitmap(bmap2, exp1, nbits); in test_bitmap_arr64()
687 next_bit = find_next_bit(bmap2, round_up(nbits, BITS_PER_LONG), nbits); in test_bitmap_arr64()
688 if (next_bit < round_up(nbits, BITS_PER_LONG)) { in test_bitmap_arr64()
690 " tail is not safely cleared: %d\n", nbits, next_bit); in test_bitmap_arr64()
694 if ((nbits % 64) && in test_bitmap_arr64()
695 (arr[(nbits - 1) / 64] & ~GENMASK_ULL((nbits - 1) % 64, 0))) { in test_bitmap_arr64()
697 nbits, arr[(nbits - 1) / 64], in test_bitmap_arr64()
698 GENMASK_ULL((nbits - 1) % 64, 0)); in test_bitmap_arr64()
702 if (nbits < EXP1_IN_BITS - 64) in test_bitmap_arr64()
703 expect_eq_uint(arr[DIV_ROUND_UP(nbits, 64)], 0xa5a5a5a5); in test_bitmap_arr64()
711 unsigned int start, nbits; in test_mem_optimisations() local
714 for (nbits = 0; nbits < 1024 - start; nbits += 8) { in test_mem_optimisations()
718 bitmap_set(bmap1, start, nbits); in test_mem_optimisations()
719 __bitmap_set(bmap2, start, nbits); in test_mem_optimisations()
721 printk("set not equal %d %d\n", start, nbits); in test_mem_optimisations()
725 printk("set not __equal %d %d\n", start, nbits); in test_mem_optimisations()
729 bitmap_clear(bmap1, start, nbits); in test_mem_optimisations()
730 __bitmap_clear(bmap2, start, nbits); in test_mem_optimisations()
732 printk("clear not equal %d %d\n", start, nbits); in test_mem_optimisations()
737 nbits); in test_mem_optimisations()
1013 unsigned int nbits; member
1061 bitmap_cut(out, in, t->first, t->cut, t->nbits); in test_bitmap_cut()
1063 expect_eq_bitmap(t->expected, out, t->nbits); in test_bitmap_cut()
1069 unsigned long nbits; member
1180 n = bitmap_print_bitmask_to_buf(print_buf, t->bitmap, t->nbits, in test_bitmap_print_buf()
1185 n = bitmap_print_list_to_buf(print_buf, t->bitmap, t->nbits, in test_bitmap_print_buf()
1192 n = bitmap_print_list_to_buf(print_buf, t->bitmap, t->nbits, in test_bitmap_print_buf()
1278 int i, n, nbits; in test_bitmap_write_helper() local
1309 for (nbits = BITS_PER_LONG; nbits >= 1; nbits--) { in test_bitmap_write_helper()
1312 w >>= (BITS_PER_LONG - nbits); in test_bitmap_write_helper()
1313 for (i = 0; i <= TEST_BIT_LEN - nbits; i++) { in test_bitmap_write_helper()
1316 for (n = 0; n < nbits; n++) in test_bitmap_write_helper()
1318 bitmap_write(bitmap, w, i, nbits); in test_bitmap_write_helper()
1320 r = bitmap_read(bitmap, i, nbits); in test_bitmap_write_helper()
1378 unsigned int cnt, nbits, i; in test_bitmap_read_perf() local
1385 for (nbits = 1; nbits <= BITS_PER_LONG; nbits++) { in test_bitmap_read_perf()
1387 if (i + nbits > TEST_BIT_LEN) in test_bitmap_read_perf()
1393 WRITE_ONCE(val, bitmap_read(bitmap, i, nbits)); in test_bitmap_read_perf()
1404 unsigned int cnt, nbits, i; in test_bitmap_write_perf() local
1411 for (nbits = 1; nbits <= BITS_PER_LONG; nbits++) { in test_bitmap_write_perf()
1413 if (i + nbits > TEST_BIT_LEN) in test_bitmap_write_perf()
1415 bitmap_write(bitmap, val, i, nbits); in test_bitmap_write_perf()