Lines Matching refs:nbits

78 		  unsigned int nbits)
80 if (!bitmap_equal(exp_bmap, bmap, nbits)) {
83 nbits, exp_bmap, nbits, bmap);
92 const unsigned long *bitmap, unsigned int nbits)
94 snprintf(pbl_buffer, sizeof(pbl_buffer), "%*pbl", nbits, bitmap);
360 unsigned int nbits = 64;
361 unsigned int nlongs = DIV_ROUND_UP(nbits, BITS_PER_LONG);
364 BUILD_BUG_ON(EXP2_IN_BITS < nbits * 2);
367 bitmap_replace(bmap, &exp2[0 * nlongs], &exp2[1 * nlongs], exp2_to_exp3_mask, nbits);
368 expect_eq_bitmap(bmap, exp3_0_1, nbits);
371 bitmap_replace(bmap, &exp2[1 * nlongs], &exp2[0 * nlongs], exp2_to_exp3_mask, nbits);
372 expect_eq_bitmap(bmap, exp3_1_0, nbits);
375 bitmap_replace(bmap, &exp2[0 * nlongs], &exp2[1 * nlongs], exp2_to_exp3_mask, nbits);
376 expect_eq_bitmap(bmap, exp3_0_1, nbits);
379 bitmap_replace(bmap, &exp2[1 * nlongs], &exp2[0 * nlongs], exp2_to_exp3_mask, nbits);
380 expect_eq_bitmap(bmap, exp3_1_0, nbits);
401 unsigned int nbits = 64;
409 bitmap_gather(bmap_gather, sg_src, sg_mask, nbits);
410 expect_eq_bitmap(sg_gather_exp, bmap_gather, nbits);
414 bitmap_scatter(bmap_scatter, sg_src, sg_mask, nbits);
415 expect_eq_bitmap(sg_scatter_exp, bmap_scatter, nbits);
419 bitmap_gather(bmap_tmp, bmap_scatter, sg_mask, nbits);
420 bitmap_scatter(bmap_res, bmap_tmp, sg_mask, nbits);
421 expect_eq_bitmap(bmap_scatter, bmap_res, nbits);
431 const int nbits;
531 err = bitmap_parselist(ptest.in, bmap, ptest.nbits);
542 && !__bitmap_equal(bmap, ptest.expected, ptest.nbits)) {
648 err = bitmap_parse(test.in, len, bmap, test.nbits);
659 && !__bitmap_equal(bmap, test.expected, test.nbits)) {
675 unsigned int nbits, next_bit;
681 for (nbits = 0; nbits < EXP1_IN_BITS; ++nbits) {
682 bitmap_to_arr32(arr, exp1, nbits);
683 bitmap_from_arr32(bmap2, arr, nbits);
684 expect_eq_bitmap(bmap2, exp1, nbits);
687 round_up(nbits, BITS_PER_LONG), nbits);
688 if (next_bit < round_up(nbits, BITS_PER_LONG)) {
689 pr_err("bitmap_copy_arr32(nbits == %d:"
691 nbits, next_bit);
695 if (nbits < EXP1_IN_BITS - 32)
696 expect_eq_uint(arr[DIV_ROUND_UP(nbits, 32)],
703 unsigned int nbits, next_bit;
709 for (nbits = 0; nbits < EXP1_IN_BITS; ++nbits) {
711 bitmap_to_arr64(arr, exp1, nbits);
712 bitmap_from_arr64(bmap2, arr, nbits);
713 expect_eq_bitmap(bmap2, exp1, nbits);
715 next_bit = find_next_bit(bmap2, round_up(nbits, BITS_PER_LONG), nbits);
716 if (next_bit < round_up(nbits, BITS_PER_LONG)) {
717 pr_err("bitmap_copy_arr64(nbits == %d:"
718 " tail is not safely cleared: %d\n", nbits, next_bit);
722 if ((nbits % 64) &&
723 (arr[(nbits - 1) / 64] & ~GENMASK_ULL((nbits - 1) % 64, 0))) {
724 pr_err("bitmap_to_arr64(nbits == %d): tail is not safely cleared: 0x%016llx (must be 0x%016llx)\n",
725 nbits, arr[(nbits - 1) / 64],
726 GENMASK_ULL((nbits - 1) % 64, 0));
730 if (nbits < EXP1_IN_BITS - 64)
731 expect_eq_uint(arr[DIV_ROUND_UP(nbits, 64)], 0xa5a5a5a5);
739 unsigned int start, nbits;
742 for (nbits = 0; nbits < 1024 - start; nbits += 8) {
746 bitmap_set(bmap1, start, nbits);
747 __bitmap_set(bmap2, start, nbits);
749 printk("set not equal %d %d\n", start, nbits);
753 printk("set not __equal %d %d\n", start, nbits);
757 bitmap_clear(bmap1, start, nbits);
758 __bitmap_clear(bmap2, start, nbits);
760 printk("clear not equal %d %d\n", start, nbits);
765 nbits);
1041 unsigned int nbits;
1089 bitmap_cut(out, in, t->first, t->cut, t->nbits);
1091 expect_eq_bitmap(t->expected, out, t->nbits);
1097 unsigned long nbits;
1208 n = bitmap_print_bitmask_to_buf(print_buf, t->bitmap, t->nbits,
1213 n = bitmap_print_list_to_buf(print_buf, t->bitmap, t->nbits,
1220 n = bitmap_print_list_to_buf(print_buf, t->bitmap, t->nbits,