From patchwork Mon Jul 18 19:28:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 12921643 X-Patchwork-Delegate: kuba@kernel.org 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 D9118C433EF for ; Mon, 18 Jul 2022 19:29:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235971AbiGRT3A (ORCPT ); Mon, 18 Jul 2022 15:29:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235933AbiGRT2y (ORCPT ); Mon, 18 Jul 2022 15:28:54 -0400 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D69ED5A; Mon, 18 Jul 2022 12:28:52 -0700 (PDT) Received: by mail-qk1-x72d.google.com with SMTP id o26so9561767qkl.6; 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=nArK0v2r1yode3l+iFyhdtsEdLmfZrSn8XAyJ9sCYe/FMI7ffT7RwcCycf8CWgMvW+ Cccl9/e6vz2d1L5RWzv/0bSgkTf0Usg4WNyV0xwDjQE8Z2xUsBn+n8rS1xhHAzjxC3Ep UykOc9GPSR4nK12nX7hRclPMA1xhjaAk6G7ifkkiDpHbcI5kYR+VctcyPMBk/vVNbCmF RQXhxXTN3YEf6MD40e0+7wkeD7VfkpnTHUheGe00FqwBQmyyjMO1Xaf/UxySBpeish/D 8zhEVvoasi8EYF56cFyl/n5EX3fWEdePoXRlFNOJSk22TCPiKigmOoX9TRNySbTnjh8i hTjw== X-Gm-Message-State: AJIora8CRPc4VGUOPscqLbrYugdFTVnlML7PKI4zrO37yMZ9ptLTb4of bZk3mxBeHERn/Y+QD72Hl2/T6M7dWh+yoQ== 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 To: linux-kernel@vger.kernel.org, Alexander Lobakin , Alexei Starovoitov , Alexey Klimov , Andrew Morton , Andrii Nakryiko , Andy Shevchenko , Ben Segall , Christoph Lameter , Dan Williams , Daniel Borkmann , Daniel Bristot de Oliveira , Dennis Zhou , Dietmar Eggemann , Eric Dumazet , Frederic Weisbecker , Guenter Roeck , Ingo Molnar , Isabella Basso , John Fastabend , Josh Poimboeuf , Juergen Gross , Juri Lelli , KP Singh , Kees Cook , Martin KaFai Lau , Mel Gorman , Miroslav Benes , Nathan Chancellor , "Paul E . McKenney" , Peter Zijlstra , Randy Dunlap , Rasmus Villemoes , Sebastian Andrzej Siewior , Song Liu , Steven Rostedt , Tejun Heo , Thomas Gleixner , Valentin Schneider , Vincent Guittot , Vlastimil Babka , Yonghong Song , Yury Norov , 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 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- lib/test_bitmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);