Lines Matching refs:nbits
86 unsigned shift, unsigned nbits) in __bitmap_shift_right() argument
88 unsigned k, lim = BITS_TO_LONGS(nbits); in __bitmap_shift_right()
90 unsigned long mask = BITMAP_LAST_WORD_MASK(nbits); in __bitmap_shift_right()
131 unsigned int shift, unsigned int nbits) in __bitmap_shift_left() argument
134 unsigned int lim = BITS_TO_LONGS(nbits); in __bitmap_shift_left()
364 int c, old_c, totaldigits, ndigits, nchunks, nbits; in __bitmap_parse() local
370 nchunks = nbits = totaldigits = c = 0; in __bitmap_parse()
422 nbits += (nchunks == 1) ? nbits_to_hold_value(chunk) : CHUNKSZ; in __bitmap_parse()
423 if (nbits > nmaskbits) in __bitmap_parse()
676 static int bitmap_pos_to_ord(const unsigned long *buf, unsigned int pos, unsigned int nbits) in bitmap_pos_to_ord() argument
678 if (pos >= nbits || !test_bit(pos, buf)) in bitmap_pos_to_ord()
702 unsigned int bitmap_ord_to_pos(const unsigned long *buf, unsigned int ord, unsigned int nbits) in bitmap_ord_to_pos() argument
706 for (pos = find_first_bit(buf, nbits); in bitmap_ord_to_pos()
707 pos < nbits && ord; in bitmap_ord_to_pos()
708 pos = find_next_bit(buf, nbits, pos + 1)) in bitmap_ord_to_pos()
748 unsigned int nbits) in bitmap_remap() argument
754 bitmap_zero(dst, nbits); in bitmap_remap()
756 w = bitmap_weight(new, nbits); in bitmap_remap()
757 for_each_set_bit(oldbit, src, nbits) { in bitmap_remap()
758 int n = bitmap_pos_to_ord(old, oldbit, nbits); in bitmap_remap()
763 set_bit(bitmap_ord_to_pos(new, n % w, nbits), dst); in bitmap_remap()
953 unsigned int sz, unsigned int nbits) in bitmap_fold() argument
959 bitmap_zero(dst, nbits); in bitmap_fold()
961 for_each_set_bit(oldbit, orig, nbits) in bitmap_fold()
1115 void bitmap_copy_le(unsigned long *dst, const unsigned long *src, unsigned int nbits) in bitmap_copy_le() argument
1119 for (i = 0; i < nbits/BITS_PER_LONG; i++) { in bitmap_copy_le()
1129 unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags) in bitmap_alloc() argument
1131 return kmalloc_array(BITS_TO_LONGS(nbits), sizeof(unsigned long), in bitmap_alloc()
1136 unsigned long *bitmap_zalloc(unsigned int nbits, gfp_t flags) in bitmap_zalloc() argument
1138 return bitmap_alloc(nbits, flags | __GFP_ZERO); in bitmap_zalloc()
1155 void bitmap_from_arr32(unsigned long *bitmap, const u32 *buf, unsigned int nbits) in bitmap_from_arr32() argument
1159 halfwords = DIV_ROUND_UP(nbits, 32); in bitmap_from_arr32()
1167 if (nbits % BITS_PER_LONG) in bitmap_from_arr32()
1168 bitmap[(halfwords - 1) / 2] &= BITMAP_LAST_WORD_MASK(nbits); in bitmap_from_arr32()
1178 void bitmap_to_arr32(u32 *buf, const unsigned long *bitmap, unsigned int nbits) in bitmap_to_arr32() argument
1182 halfwords = DIV_ROUND_UP(nbits, 32); in bitmap_to_arr32()
1190 if (nbits % BITS_PER_LONG) in bitmap_to_arr32()
1191 buf[halfwords - 1] &= (u32) (UINT_MAX >> ((-nbits) & 31)); in bitmap_to_arr32()