@@ -243,21 +243,18 @@ extern int bitmap_print_list_to_buf(char *buf, const unsigned long *maskp,
static inline void bitmap_zero(unsigned long *dst, unsigned int nbits)
{
- unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
- memset(dst, 0, len);
+ memset(dst, 0, bitmap_size(nbits));
}
static inline void bitmap_fill(unsigned long *dst, unsigned int nbits)
{
- unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
- memset(dst, 0xff, len);
+ memset(dst, 0xff, bitmap_size(nbits));
}
static inline void bitmap_copy(unsigned long *dst, const unsigned long *src,
unsigned int nbits)
{
- unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
- memcpy(dst, src, len);
+ memcpy(dst, src, bitmap_size(nbits));
}
/*
Simplify code and take advantage of the new bitmap_size() function. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- include/linux/bitmap.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)