From patchwork Mon Jul 18 19:28:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 12921664 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98ED0CCA486 for ; Mon, 18 Jul 2022 19:28:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C1456940008; Mon, 18 Jul 2022 15:28:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B01A5940007; Mon, 18 Jul 2022 15:28:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9563C940008; Mon, 18 Jul 2022 15:28:55 -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 7E82E940007 for ; Mon, 18 Jul 2022 15:28:55 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 4DD5220A21 for ; Mon, 18 Jul 2022 19:28:55 +0000 (UTC) X-FDA: 79701208230.12.A778276 Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) by imf13.hostedemail.com (Postfix) with ESMTP id A4FBE20095 for ; Mon, 18 Jul 2022 19:28:54 +0000 (UTC) Received: by mail-qv1-f41.google.com with SMTP id m10so5644371qvu.4 for ; Mon, 18 Jul 2022 12:28:54 -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=kggq/8QR9J7+hQqC85Z7UvjwISsJybPyVWycNM36A94=; b=dhlOzRWSRCVDeB5G/ojYUTukZ+P2gcdtsU+jMLUstlXFlOrTp2ph3aG0NXBV8ztstI OXMYLzx6YxjDhp2P9YRr9zilu9HXR7fY5pvPhtwR3iRWzZwfVtgG9lVHCT2ZTqpw0+Ml +OgpMDSbWao5AC6+qrMwM3Db0YqXaBy6MaEv7wnj6amC+iUAq4cv2bT0A4L8zdy5Euao VAKc32hcR8GaNzT5A9JfavcEovAoouxP/ve/GxdRAbv82Ya4GcKRYbxbQkMPkB47IqRX kYT71Abd+YiP5O3A8ckxB+XNkCs6wKALUnGT5t/3o7qzxFLs7cpnxkdiCIV74UJKfkcN 7sOw== 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=kggq/8QR9J7+hQqC85Z7UvjwISsJybPyVWycNM36A94=; b=L67r+hZblsuSfbL4kGAUobJP2cDyhaG2qXdTzIhZh1/bkfs9jrjJU8XUlTSJqurKr1 i6Avksq99IZZKE+ZByFO6PWtjDJfY1ltbnvxPYYWUJdHP3B2IS7VC83OYJtvTNVV8RYc BngncDseg/w4qS/9nKSZwp5tOT917M3QBC/s3SvYpJ//B7awlYtRONUt6i0Wti1SRGp4 eaBx5Hc1uhiifpXxRZftTigFfNY2NgWfg0zXcS4OTYkwBKc4Ve0J6Sm1Xn1BlcMa6uba stqg/XkAbjQjQa4s42fpWyCsuZGLFUwIIce7+pa/sR9/99rOB5lNFV0rSmAEewUkD43t H/WQ== X-Gm-Message-State: AJIora/qMjG96wDSp/ykxs5rRslYaPsLuTNVXOZUi1LjEXML6Q4JApKJ 9UzwTMhv7j/gg5v+bY0ZmgQ= X-Google-Smtp-Source: AGRyM1u3EM0rXTHhAD/Z1aIEbA912gwLNc43tN+zBsepF5isd7Swws3o9Azy4V52O5TNXWBcbJiNlg== X-Received: by 2002:a05:6214:246f:b0:473:5145:d906 with SMTP id im15-20020a056214246f00b004735145d906mr22495118qvb.126.1658172533740; Mon, 18 Jul 2022 12:28:53 -0700 (PDT) Received: from localhost ([2601:4c1:c100:1230:ab01:d009:465a:5ab1]) by smtp.gmail.com with ESMTPSA id i21-20020a05620a405500b006b5f4b7b088sm1783681qko.108.2022.07.18.12.28.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 12:28:53 -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 06/16] lib/test_bitmap: delete meaningless test for bitmap_cut Date: Mon, 18 Jul 2022 12:28:34 -0700 Message-Id: <20220718192844.1805158-7-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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658172534; 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=kggq/8QR9J7+hQqC85Z7UvjwISsJybPyVWycNM36A94=; b=f4QNxpKG4TiGw/5iaEvIhho8lo0OckogyvGyi/Og0Ji0YfnSAJlTbD3BV69BTCK7fbjanq ht9AIs4r7RQMCi4Gz46zsc5A6azN3ScuiIrzIU92rLYn6gYPoLtfPVgIi7ytOrxgD8k9As 0j+xz8XcoYHzvEI+goQLo0MrI60iyxM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658172534; a=rsa-sha256; cv=none; b=sD4NkbpJhRFKBAMiojJJk7qsV+Wb+7Ol1xftXFfurGSp09aXBzRxB3MsL3KlLn1V0Yo1Ih BbvAl3fiSTX+41PHCVkMT02ejbvynUO3Oc1p8NBWtKxHw4O4UEqjqgCkETpkHy8MHxuLU3 8WjBRRhqN/WqcB7C4qJBG4qXZVSliUE= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=dhlOzRWS; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf13.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.219.41 as permitted sender) smtp.mailfrom=yury.norov@gmail.com X-Stat-Signature: 4rcbetku5c1ihphmofzrywid5m9gkt13 X-Rspamd-Queue-Id: A4FBE20095 X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=dhlOzRWS; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf13.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.219.41 as permitted sender) smtp.mailfrom=yury.norov@gmail.com X-Rspamd-Server: rspam06 X-HE-Tag: 1658172534-441299 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: One of bitmap_cut() tests passed it with: nbits = BITS_PER_LONG; first = BITS_PER_LONG; cut = BITS_PER_LONG; This test is useless because the range to cut is not inside the bitmap. This should normally raise an error, but bitmap_cut() is void and returns nothing. To check if the test is passed, it just tests that the memory is not touched by bitmap_cut(), which is probably not correct, because if a function is passed with wrong parameters, it's too optimistic to expect a correct, or even sane behavior. Now that we have bitmap_check_params(), there's a tool to detect such things in real code, and we can drop the test. Signed-off-by: Yury Norov --- lib/test_bitmap.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c index 8bd279a7633f..c1ea449aae2d 100644 --- a/lib/test_bitmap.c +++ b/lib/test_bitmap.c @@ -707,10 +707,6 @@ static struct test_bitmap_cut test_cut[] = { { 15, 16, 32, { 0xa5a5a5a5UL, }, { 0x0000a5a5UL, }, }, { 16, 15, 32, { 0xa5a5a5a5UL, }, { 0x0001a5a5UL, }, }, - { BITS_PER_LONG, BITS_PER_LONG, BITS_PER_LONG, - { 0xa5a5a5a5UL, 0xa5a5a5a5UL, }, - { 0xa5a5a5a5UL, 0xa5a5a5a5UL, }, - }, { 1, BITS_PER_LONG - 1, BITS_PER_LONG, { 0xa5a5a5a5UL, 0xa5a5a5a5UL, }, { 0x00000001UL, 0x00000001UL, },