From nobody Sun Apr 5 16:28:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A04B9ECAAD3 for ; Sun, 18 Sep 2022 03:07:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229586AbiIRDHe (ORCPT ); Sat, 17 Sep 2022 23:07:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbiIRDHW (ORCPT ); Sat, 17 Sep 2022 23:07:22 -0400 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E06BA29827 for ; Sat, 17 Sep 2022 20:07:20 -0700 (PDT) Received: by mail-qk1-x72a.google.com with SMTP id d15so18430446qka.9 for ; Sat, 17 Sep 2022 20:07:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=hIH+cYLLu5nISquJxX2Y2BfHZrCs6NlFVQp9n+J7Pgc=; b=fPKERsemDqrcstzHiRkssOFxyuyOWKPWXycQixi0LQTkrcLpHXWh0n/+WGRK/CLiA3 /s0MWj48h6ZTtNSH7dU4Kb9hn2xHyM66/KhzqOgMQw9XM4GSYm3Xqv2wovwFdTJZmCj9 Rkba5PLj+irLjvP+bUWO+787NSKs9jxHmYdmEbePdg+zR7yfkO8vSxIEHyb1bTg6xc0A TVRhV9ERIBm4Aeadfuhcpaji5OYWOe1R7eynSDg1bQ93hrQm74JZ0hvMgKzg0IawR+dC AjnfjzE8Y3/WdUJ2tIRSFIH+wGt1uwwliOCg1E2ihwBhJ99aYaBFcvaQSWvhVuh9bxmw eF3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=hIH+cYLLu5nISquJxX2Y2BfHZrCs6NlFVQp9n+J7Pgc=; b=vmM086yK6XpEGJqzEC7v41wHBLHMUqJ6APLTujf6ZoXKn0hpRHGy4TrnnoliMfoO31 TCW6pwCjQNhESgi7KVhV04DzywPY8xiDLX8HTs8GaZeeoDik8qMAFp0b+4xbbqiBc0fy BWhULwF1xL9IyMc4Q1epqsLOQy/j/IR37cdcIZJhBUmQVbpH75Y52zZas5JBJYGOYvwV wMdtvlN1CpiEDyaOjasoFwGA1u8dP+7UBKF6/pBjz51/9Y6+B7oS4Lv5ydRuiNZhSR05 SZ4NQi0mXIRC/zbLugBEpGfSihN5gw1KplvIn8bwuhbucjDE8CsvvQXwwm3iK4ISxWR/ QzKA== X-Gm-Message-State: ACrzQf2k/P59dujBnlLt7jKQZm07Pe49GLWlw1YrvmiDfwRqvpFFV+jq 88fwP1SLgLIK4E/opqKSkk/SZEurIeg= X-Google-Smtp-Source: AMsMyM7EYcJ7TQqwfb69HXS3kYjkopMU3K7dFgaYkrMBgx2XfKEulJbaiBzu3vSxAZopiPdewuwJaw== X-Received: by 2002:a37:c09:0:b0:6cb:d61d:22b8 with SMTP id 9-20020a370c09000000b006cbd61d22b8mr9115535qkm.130.1663470439786; Sat, 17 Sep 2022 20:07:19 -0700 (PDT) Received: from localhost ([2601:4c1:c100:2270:a495:2224:867e:566a]) by smtp.gmail.com with ESMTPSA id a12-20020a05620a16cc00b006a5d2eb58b2sm8844806qkn.33.2022.09.17.20.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Sep 2022 20:07:19 -0700 (PDT) From: Yury Norov To: linux-kernel@vger.kernel.org, Alexander Lobakin , Andy Shevchenko , Arnd Bergmann , David Gow , Eric Dumazet , Isabella Basso , Kees Cook , Keith Busch , Kumar Kartikeya Dwivedi , Marco Elver , Mark Rutland , Rasmus Villemoes , Steven Rostedt , =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , Valentin Schneider Cc: Yury Norov Subject: [PATCH v3 1/6] lib/bitmap: don't call __bitmap_weight() in kernel code Date: Sat, 17 Sep 2022 20:07:11 -0700 Message-Id: <20220918030716.1252285-2-yury.norov@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220918030716.1252285-1-yury.norov@gmail.com> References: <20220918030716.1252285-1-yury.norov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" __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 --- 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) =20 buf =3D (ulong *)bh->b_data; =20 - used =3D __bitmap_weight(buf, wbits); + used =3D bitmap_weight(buf, wbits); if (used < wbits) { frb =3D wbits - used; wnd->free_bits[iw] =3D frb; @@ -1364,7 +1364,7 @@ int wnd_extend(struct wnd_bitmap *wnd, size_t new_bit= s) buf =3D (ulong *)bh->b_data; =20 __bitmap_clear(buf, b0, blocksize * 8 - b0); - frb =3D wbits - __bitmap_weight(buf, wbits); + frb =3D wbits - bitmap_weight(buf, wbits); wnd->total_zeroes +=3D frb - wnd->free_bits[iw]; wnd->free_bits[iw] =3D frb; =20 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 >=3D nbits || !test_bit(pos, buf)) return -1; =20 - return __bitmap_weight(buf, pos); + return bitmap_weight(buf, pos); } =20 /** --=20 2.34.1