Commit 70a1cb10 authored by Yury Norov's avatar Yury Norov

lib/bitmap: don't call __bitmap_weight() in kernel code

__bitmap_weight() is not to be used directly in the kernel code because
it's a helper for bitmap_weight(). Switch everything to bitmap_weight().
Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
parent 6333cb31
...@@ -560,7 +560,7 @@ static int wnd_rescan(struct wnd_bitmap *wnd) ...@@ -560,7 +560,7 @@ static int wnd_rescan(struct wnd_bitmap *wnd)
buf = (ulong *)bh->b_data; buf = (ulong *)bh->b_data;
used = __bitmap_weight(buf, wbits); used = bitmap_weight(buf, wbits);
if (used < wbits) { if (used < wbits) {
frb = wbits - used; frb = wbits - used;
wnd->free_bits[iw] = frb; wnd->free_bits[iw] = frb;
...@@ -1364,7 +1364,7 @@ int wnd_extend(struct wnd_bitmap *wnd, size_t new_bits) ...@@ -1364,7 +1364,7 @@ int wnd_extend(struct wnd_bitmap *wnd, size_t new_bits)
buf = (ulong *)bh->b_data; buf = (ulong *)bh->b_data;
__bitmap_clear(buf, b0, blocksize * 8 - b0); __bitmap_clear(buf, b0, blocksize * 8 - b0);
frb = wbits - __bitmap_weight(buf, wbits); frb = wbits - bitmap_weight(buf, wbits);
wnd->total_zeroes += frb - wnd->free_bits[iw]; wnd->total_zeroes += frb - wnd->free_bits[iw];
wnd->free_bits[iw] = frb; wnd->free_bits[iw] = frb;
......
...@@ -953,7 +953,7 @@ static int bitmap_pos_to_ord(const unsigned long *buf, unsigned int pos, unsigne ...@@ -953,7 +953,7 @@ static int bitmap_pos_to_ord(const unsigned long *buf, unsigned int pos, unsigne
if (pos >= nbits || !test_bit(pos, buf)) if (pos >= nbits || !test_bit(pos, buf))
return -1; return -1;
return __bitmap_weight(buf, pos); return bitmap_weight(buf, pos);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment