Message ID | 20220718192844.1805158-5-yury.norov@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E14F6CCA479 for <linux-mm@archiver.kernel.org>; Mon, 18 Jul 2022 19:28:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 203628E0003; Mon, 18 Jul 2022 15:28:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 18A988E0002; Mon, 18 Jul 2022 15:28:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 02CE58E0003; Mon, 18 Jul 2022 15:28:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D91168E0002 for <linux-mm@kvack.org>; Mon, 18 Jul 2022 15:28:52 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id ABEC680945 for <linux-mm@kvack.org>; Mon, 18 Jul 2022 19:28:52 +0000 (UTC) X-FDA: 79701208104.10.06E2462 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) by imf30.hostedemail.com (Postfix) with ESMTP id 4A54880088 for <linux-mm@kvack.org>; Mon, 18 Jul 2022 19:28:52 +0000 (UTC) Received: by mail-qk1-f174.google.com with SMTP id m16so5308738qka.12 for <linux-mm@kvack.org>; Mon, 18 Jul 2022 12:28:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=WuubJCN67Jl+OjN8nViAm+NVBqJ2ywJqSxExI1yjjeo=; b=Tj6uBzad4HGB6EL0M1yus7P2xl8seTebl3KEY60QiHYHkiZzGlnZJc4zmMQ715lBQb V+6rCjlFtE36SY7lmQBsjFybnyNA/OpYbPg+Hxm3taVetxQSzz05FbXjQEqoSn3tr68N fufksI4iYgEDgfiqAfDBwg7RDixJD5/BbGOR3iYboPjgzPCnwUY3I9q81BKlZDy93R5+ TYLpPb/vjZhMTWj53wGRv+e2qfs4M6ZZ3ek9UJ68NbZRFgDae6SXyqs1nFFZVE0b4GJf TuETrm14lrx8VLkbDZWKHiMSYX1+sOP0ozMNOUt4xFlsRcKHdAtHqy1wiM2QBsaIJik6 D9HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WuubJCN67Jl+OjN8nViAm+NVBqJ2ywJqSxExI1yjjeo=; b=fc8Gw3jFm6GXstoqDxtpx/DYZoMfsffP+uE+QaD+nHPNeiHmLc94T0kks7WI/sw8oD UtJzilnrixswqVWVKtgyx8Ze7INmvlUuDCN+tvD6Td7DsguFOBJADDdY6hN9wBDcnh1W QonrgXlsEszBVdskiQVQeWI8HB0FprB9cKKxewAMBgEFps2nG3/HBcDJI837Cn3r+7k8 IrEKADAdZiGGHA0On/E2KuLGNxhm8xljBx1XqmuHzEwqgG3C5Hnd838Y1ZB000oCYIHE UXcFHTdeULRE2bLd65E8MJpA8Zhpa4msrOTZ2ulOfYEN1lnEX96Z3GtjPdP0jraciYq1 gOQQ== X-Gm-Message-State: AJIora9nVoMMtJB0SNetXLAnDkpz+SiGq4guQjWQoCcAdOseYOQILYDM p8SvPzTnTkFIqtzcah9i0Wc= X-Google-Smtp-Source: AGRyM1utJxde5Ak8ZdjBXmB+6RTWRe3dLKOIt69li9dLPfU8C1nB6Z6dKZAjbNpuMZO2dr2cItKKhg== X-Received: by 2002:a37:b346:0:b0:6b2:8e4c:690c with SMTP id c67-20020a37b346000000b006b28e4c690cmr18431369qkf.654.1658172531539; Mon, 18 Jul 2022 12:28:51 -0700 (PDT) Received: from localhost ([2601:4c1:c100:1230:ab01:d009:465a:5ab1]) by smtp.gmail.com with ESMTPSA id r2-20020ac87ee2000000b0031ed590433bsm8607338qtc.78.2022.07.18.12.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 12:28:51 -0700 (PDT) From: Yury Norov <yury.norov@gmail.com> To: linux-kernel@vger.kernel.org, Alexander Lobakin <alexandr.lobakin@intel.com>, Alexei Starovoitov <ast@kernel.org>, Alexey Klimov <aklimov@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, Andrii Nakryiko <andrii@kernel.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Ben Segall <bsegall@google.com>, Christoph Lameter <cl@linux.com>, Dan Williams <dan.j.williams@intel.com>, Daniel Borkmann <daniel@iogearbox.net>, Daniel Bristot de Oliveira <bristot@redhat.com>, Dennis Zhou <dennis@kernel.org>, Dietmar Eggemann <dietmar.eggemann@arm.com>, Eric Dumazet <edumazet@google.com>, Frederic Weisbecker <fweisbec@gmail.com>, Guenter Roeck <linux@roeck-us.net>, Ingo Molnar <mingo@redhat.com>, Isabella Basso <isabbasso@riseup.net>, John Fastabend <john.fastabend@gmail.com>, Josh Poimboeuf <jpoimboe@kernel.org>, Juergen Gross <jgross@suse.com>, Juri Lelli <juri.lelli@redhat.com>, KP Singh <kpsingh@kernel.org>, Kees Cook <keescook@chromium.org>, Martin KaFai Lau <kafai@fb.com>, Mel Gorman <mgorman@suse.de>, Miroslav Benes <mbenes@suse.cz>, Nathan Chancellor <nathan@kernel.org>, "Paul E . McKenney" <paulmck@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Randy Dunlap <rdunlap@infradead.org>, Rasmus Villemoes <linux@rasmusvillemoes.dk>, Sebastian Andrzej Siewior <bigeasy@linutronix.de>, Song Liu <songliubraving@fb.com>, Steven Rostedt <rostedt@goodmis.org>, Tejun Heo <tj@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, Valentin Schneider <vschneid@redhat.com>, Vincent Guittot <vincent.guittot@linaro.org>, Vlastimil Babka <vbabka@suse.cz>, Yonghong Song <yhs@fb.com>, Yury Norov <yury.norov@gmail.com>, linux-mm@kvack.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH 04/16] lib/test_bitmap: test test_bitmap_arr{32,64} starting from nbits == 1 Date: Mon, 18 Jul 2022 12:28:32 -0700 Message-Id: <20220718192844.1805158-5-yury.norov@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220718192844.1805158-1-yury.norov@gmail.com> References: <20220718192844.1805158-1-yury.norov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658172532; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=WuubJCN67Jl+OjN8nViAm+NVBqJ2ywJqSxExI1yjjeo=; b=tdvdHH/UcBTRiEpInigrvnXL4eJ6OUAhZpExH153b3y0+TDB9VByyJdWuIZ7j3jq2qNZhz cXHZ8/QeA9+3hHN9s1VtfLHHd7DPdKIriyGdnGGrl1D1J5yG1lwhZsZo1H7ERvxEWYIJmR 2zGyp9iAw5BQLhi9KUqDJJ4dR1RVXN4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658172532; a=rsa-sha256; cv=none; b=RMb4ygeLrvs9NYXsBXMikUABzeFORyykCa2Q5plQtnCaGkBETJ1XkGgSpGtc4navvohbCT 6FZyZmqQTxvs54IMelB3RLrxvLDYztMnHhdZXsu+DAsXBCOh5NJLml6BHlv5rYKHS/ZFjA TEDWjUZmwNImmBIARokHZDLmSoH32vE= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Tj6uBzad; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.222.174 as permitted sender) smtp.mailfrom=yury.norov@gmail.com X-Stat-Signature: c11qrhkkz94u1he3746bq9j14afijdbq X-Rspamd-Queue-Id: 4A54880088 X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Tj6uBzad; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.222.174 as permitted sender) smtp.mailfrom=yury.norov@gmail.com X-Rspamd-Server: rspam06 X-HE-Tag: 1658172532-962722 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Introduce DEBUG_BITMAP config option and bitmap_check_params()
|
expand
|
On Mon, Jul 18, 2022 at 12:28:32PM -0700, Yury Norov wrote: > nbits == 0 is useless. In a real code it's most probably a sign of > error, and it makes CONFIG_DEBUG_BITMAP barking. Ditto as per previous patch.
diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c index 2a70393ac011..bc48d992d10d 100644 --- a/lib/test_bitmap.c +++ b/lib/test_bitmap.c @@ -567,7 +567,7 @@ static void __init test_bitmap_arr32(void) memset(arr, 0xa5, sizeof(arr)); - for (nbits = 0; nbits < EXP1_IN_BITS; ++nbits) { + for (nbits = 1; nbits < EXP1_IN_BITS; ++nbits) { bitmap_to_arr32(arr, exp1, nbits); bitmap_from_arr32(bmap2, arr, nbits); expect_eq_bitmap(bmap2, exp1, nbits); @@ -593,7 +593,7 @@ static void __init test_bitmap_arr64(void) memset(arr, 0xa5, sizeof(arr)); - for (nbits = 0; nbits < EXP1_IN_BITS; ++nbits) { + for (nbits = 1; nbits < EXP1_IN_BITS; ++nbits) { memset(bmap2, 0xff, sizeof(arr)); bitmap_to_arr64(arr, exp1, nbits); bitmap_from_arr64(bmap2, arr, nbits);
nbits == 0 is useless. In a real code it's most probably a sign of error, and it makes CONFIG_DEBUG_BITMAP barking. Signed-off-by: Yury Norov <yury.norov@gmail.com> --- lib/test_bitmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)