[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220918030716.1252285-2-yury.norov@gmail.com>
Date: Sat, 17 Sep 2022 20:07:11 -0700
From: Yury Norov <yury.norov@...il.com>
To: linux-kernel@...r.kernel.org,
Alexander Lobakin <alexandr.lobakin@...el.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Arnd Bergmann <arnd@...db.de>, David Gow <davidgow@...gle.com>,
Eric Dumazet <edumazet@...gle.com>,
Isabella Basso <isabbasso@...eup.net>,
Kees Cook <keescook@...omium.org>,
Keith Busch <kbusch@...nel.org>,
Kumar Kartikeya Dwivedi <memxor@...il.com>,
Marco Elver <elver@...gle.com>,
Mark Rutland <mark.rutland@....com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Steven Rostedt <rostedt@...dmis.org>,
Toke Høiland-Jørgensen <toke@...hat.com>,
Valentin Schneider <vschneid@...hat.com>
Cc: Yury Norov <yury.norov@...il.com>
Subject: [PATCH v3 1/6] 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: Yury Norov <yury.norov@...il.com>
---
fs/ntfs3/bitmap.c | 4 ++--
lib/bitmap.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/ntfs3/bitmap.c b/fs/ntfs3/bitmap.c
index 5d44ceac855b..e92bbd754365 100644
--- a/fs/ntfs3/bitmap.c
+++ b/fs/ntfs3/bitmap.c
@@ -560,7 +560,7 @@ static int wnd_rescan(struct wnd_bitmap *wnd)
buf = (ulong *)bh->b_data;
- used = __bitmap_weight(buf, wbits);
+ used = bitmap_weight(buf, wbits);
if (used < wbits) {
frb = wbits - used;
wnd->free_bits[iw] = frb;
@@ -1364,7 +1364,7 @@ int wnd_extend(struct wnd_bitmap *wnd, size_t new_bits)
buf = (ulong *)bh->b_data;
__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->free_bits[iw] = frb;
diff --git a/lib/bitmap.c b/lib/bitmap.c
index 488e6c3e5acc..d56e275db73e 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -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))
return -1;
- return __bitmap_weight(buf, pos);
+ return bitmap_weight(buf, pos);
}
/**
--
2.34.1
Powered by blists - more mailing lists