Home | History | Annotate | Download | only in linux

Lines Matching refs:nbits

15 #define BITMAP_LAST_WORD_MASK(nbits)					\
17 ((nbits) % BITS_PER_LONG) ? \
18 (1UL<<((nbits) % BITS_PER_LONG))-1 : ~0UL \
21 #define small_const_nbits(nbits) \
22 (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG)
24 static inline void bitmap_zero(unsigned long *dst, int nbits)
26 if (small_const_nbits(nbits))
29 int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
34 static inline int bitmap_weight(const unsigned long *src, int nbits)
36 if (small_const_nbits(nbits))
37 return hweight_long(*src & BITMAP_LAST_WORD_MASK(nbits));
38 return __bitmap_weight(src, nbits);