Lines Matching refs:nbits
102 unsigned shift, unsigned nbits) in __bitmap_shift_right() argument
104 unsigned k, lim = BITS_TO_LONGS(nbits); in __bitmap_shift_right()
106 unsigned long mask = BITMAP_LAST_WORD_MASK(nbits); in __bitmap_shift_right()
147 unsigned int shift, unsigned int nbits) in __bitmap_shift_left() argument
150 unsigned int lim = BITS_TO_LONGS(nbits); in __bitmap_shift_left()
380 int c, old_c, totaldigits, ndigits, nchunks, nbits; in __bitmap_parse() local
386 nchunks = nbits = totaldigits = c = 0; in __bitmap_parse()
438 nbits += (nchunks == 1) ? nbits_to_hold_value(chunk) : CHUNKSZ; in __bitmap_parse()
439 if (nbits > nmaskbits) in __bitmap_parse()
515 unsigned long *bitmap, int nbits) in bitmap_set_region() argument
519 if (r->end >= nbits) in bitmap_set_region()
721 static int bitmap_pos_to_ord(const unsigned long *buf, unsigned int pos, unsigned int nbits) in bitmap_pos_to_ord() argument
723 if (pos >= nbits || !test_bit(pos, buf)) in bitmap_pos_to_ord()
747 unsigned int bitmap_ord_to_pos(const unsigned long *buf, unsigned int ord, unsigned int nbits) in bitmap_ord_to_pos() argument
751 for (pos = find_first_bit(buf, nbits); in bitmap_ord_to_pos()
752 pos < nbits && ord; in bitmap_ord_to_pos()
753 pos = find_next_bit(buf, nbits, pos + 1)) in bitmap_ord_to_pos()
793 unsigned int nbits) in bitmap_remap() argument
799 bitmap_zero(dst, nbits); in bitmap_remap()
801 w = bitmap_weight(new, nbits); in bitmap_remap()
802 for_each_set_bit(oldbit, src, nbits) { in bitmap_remap()
803 int n = bitmap_pos_to_ord(old, oldbit, nbits); in bitmap_remap()
808 set_bit(bitmap_ord_to_pos(new, n % w, nbits), dst); in bitmap_remap()
995 unsigned int sz, unsigned int nbits) in bitmap_fold() argument
1001 bitmap_zero(dst, nbits); in bitmap_fold()
1003 for_each_set_bit(oldbit, orig, nbits) in bitmap_fold()
1157 void bitmap_copy_le(unsigned long *dst, const unsigned long *src, unsigned int nbits) in bitmap_copy_le() argument
1161 for (i = 0; i < nbits/BITS_PER_LONG; i++) { in bitmap_copy_le()
1171 unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags) in bitmap_alloc() argument
1173 return kmalloc_array(BITS_TO_LONGS(nbits), sizeof(unsigned long), in bitmap_alloc()
1178 unsigned long *bitmap_zalloc(unsigned int nbits, gfp_t flags) in bitmap_zalloc() argument
1180 return bitmap_alloc(nbits, flags | __GFP_ZERO); in bitmap_zalloc()
1197 void bitmap_from_arr32(unsigned long *bitmap, const u32 *buf, unsigned int nbits) in bitmap_from_arr32() argument
1201 halfwords = DIV_ROUND_UP(nbits, 32); in bitmap_from_arr32()
1209 if (nbits % BITS_PER_LONG) in bitmap_from_arr32()
1210 bitmap[(halfwords - 1) / 2] &= BITMAP_LAST_WORD_MASK(nbits); in bitmap_from_arr32()
1220 void bitmap_to_arr32(u32 *buf, const unsigned long *bitmap, unsigned int nbits) in bitmap_to_arr32() argument
1224 halfwords = DIV_ROUND_UP(nbits, 32); in bitmap_to_arr32()
1232 if (nbits % BITS_PER_LONG) in bitmap_to_arr32()
1233 buf[halfwords - 1] &= (u32) (UINT_MAX >> ((-nbits) & 31)); in bitmap_to_arr32()