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);
337 unsigned int nbits = 64;
338 unsigned int nlongs = DIV_ROUND_UP(nbits, BITS_PER_LONG);
341 BUILD_BUG_ON(EXP2_IN_BITS < nbits * 2);
344 bitmap_replace(bmap, &exp2[0 * nlongs], &exp2[1 * nlongs], exp2_to_exp3_mask, nbits);
345 expect_eq_bitmap(bmap, exp3_0_1, nbits);
348 bitmap_replace(bmap, &exp2[1 * nlongs], &exp2[0 * nlongs], exp2_to_exp3_mask, nbits);
349 expect_eq_bitmap(bmap, exp3_1_0, nbits);
352 bitmap_replace(bmap, &exp2[0 * nlongs], &exp2[1 * nlongs], exp2_to_exp3_mask, nbits);
353 expect_eq_bitmap(bmap, exp3_0_1, nbits);
356 bitmap_replace(bmap, &exp2[1 * nlongs], &exp2[0 * nlongs], exp2_to_exp3_mask, nbits);
357 expect_eq_bitmap(bmap, exp3_1_0, nbits);
367 const int nbits;
467 err = bitmap_parselist(ptest.in, bmap, ptest.nbits);
478 && !__bitmap_equal(bmap, ptest.expected, ptest.nbits)) {
584 err = bitmap_parse(test.in, len, bmap, test.nbits);
595 && !__bitmap_equal(bmap, test.expected, test.nbits)) {
611 unsigned int nbits, next_bit;
617 for (nbits = 0; nbits < EXP1_IN_BITS; ++nbits) {
618 bitmap_to_arr32(arr, exp1, nbits);
619 bitmap_from_arr32(bmap2, arr, nbits);
620 expect_eq_bitmap(bmap2, exp1, nbits);
623 round_up(nbits, BITS_PER_LONG), nbits);
624 if (next_bit < round_up(nbits, BITS_PER_LONG)) {
625 pr_err("bitmap_copy_arr32(nbits == %d:"
627 nbits, next_bit);
631 if (nbits < EXP1_IN_BITS - 32)
632 expect_eq_uint(arr[DIV_ROUND_UP(nbits, 32)],
639 unsigned int nbits, next_bit;
645 for (nbits = 0; nbits < EXP1_IN_BITS; ++nbits) {
647 bitmap_to_arr64(arr, exp1, nbits);
648 bitmap_from_arr64(bmap2, arr, nbits);
649 expect_eq_bitmap(bmap2, exp1, nbits);
651 next_bit = find_next_bit(bmap2, round_up(nbits, BITS_PER_LONG), nbits);
652 if (next_bit < round_up(nbits, BITS_PER_LONG)) {
653 pr_err("bitmap_copy_arr64(nbits == %d:"
654 " tail is not safely cleared: %d\n", nbits, next_bit);
658 if ((nbits % 64) &&
659 (arr[(nbits - 1) / 64] & ~GENMASK_ULL((nbits - 1) % 64, 0))) {
660 pr_err("bitmap_to_arr64(nbits == %d): tail is not safely cleared: 0x%016llx (must be 0x%016llx)\n",
661 nbits, arr[(nbits - 1) / 64],
662 GENMASK_ULL((nbits - 1) % 64, 0));
666 if (nbits < EXP1_IN_BITS - 64)
667 expect_eq_uint(arr[DIV_ROUND_UP(nbits, 64)], 0xa5a5a5a5);
675 unsigned int start, nbits;
678 for (nbits = 0; nbits < 1024 - start; nbits += 8) {
682 bitmap_set(bmap1, start, nbits);
683 __bitmap_set(bmap2, start, nbits);
685 printk("set not equal %d %d\n", start, nbits);
689 printk("set not __equal %d %d\n", start, nbits);
693 bitmap_clear(bmap1, start, nbits);
694 __bitmap_clear(bmap2, start, nbits);
696 printk("clear not equal %d %d\n", start, nbits);
701 nbits);
977 unsigned int nbits;
1025 bitmap_cut(out, in, t->first, t->cut, t->nbits);
1027 expect_eq_bitmap(t->expected, out, t->nbits);
1033 unsigned long nbits;
1144 n = bitmap_print_bitmask_to_buf(print_buf, t->bitmap, t->nbits,
1149 n = bitmap_print_list_to_buf(print_buf, t->bitmap, t->nbits,
1156 n = bitmap_print_list_to_buf(print_buf, t->bitmap, t->nbits,