From mboxrd@z Thu Jan 1 00:00:00 1970 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 62A27C43334 for ; Mon, 18 Jul 2022 21:12:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ED1E16B0083; Mon, 18 Jul 2022 17:12:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E81F66B0085; Mon, 18 Jul 2022 17:12:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D4A706B0087; Mon, 18 Jul 2022 17:12:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id C6B296B0083 for ; Mon, 18 Jul 2022 17:12:00 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id A0484120D56 for ; Mon, 18 Jul 2022 21:12:00 +0000 (UTC) X-FDA: 79701468000.22.2D0F7D5 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf07.hostedemail.com (Postfix) with ESMTP id 162EA4005D for ; Mon, 18 Jul 2022 21:11:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658178719; x=1689714719; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=B8FiBLFp5csoUvFgk1WR/dfs+8dLITXSfuetGEHiUoY=; b=BVcx98f4msZ9jynpd6y3br8JlTgDSvq1ruTPXvxUkqd/ngZRHCeozPxH uDMPyQX/KJE3jaXUL8DL33qJjFxibgaG1J4F7cyVCIya++iFOLEyqDCBZ D7oTGGbtTsMKWuXifM9EqnBmeDsbWsG20vRJXyR8Xkky638sJ9hYg/kFq TiaoobrOc5kwQE0tn7AIsdheDRHBZ4LLpjTvwSG5NpeAEW+39UPJ1wiD7 N01gMA6qeziC8+q3EFRPKmodJD4KlZKjASdc8yV0opL3/uBUWSsEwYfRd UTTwAUBS1h1vyvsjIy0UqaaWY5Q8+ms7gadLibYQLRQWLtzyMEqCcgart g==; X-IronPort-AV: E=McAfee;i="6400,9594,10412"; a="286340204" X-IronPort-AV: E=Sophos;i="5.92,282,1650956400"; d="scan'208";a="286340204" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2022 14:11:58 -0700 X-IronPort-AV: E=Sophos;i="5.92,282,1650956400"; d="scan'208";a="739614852" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2022 14:11:48 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1oDY1n-001OYv-2P; Tue, 19 Jul 2022 00:11:43 +0300 Date: Tue, 19 Jul 2022 00:11:43 +0300 From: Andy Shevchenko To: Yury Norov Cc: linux-kernel@vger.kernel.org, Alexander Lobakin , Alexei Starovoitov , Alexey Klimov , Andrew Morton , Andrii Nakryiko , 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 , linux-mm@kvack.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH 06/16] lib/test_bitmap: delete meaningless test for bitmap_cut Message-ID: References: <20220718192844.1805158-1-yury.norov@gmail.com> <20220718192844.1805158-7-yury.norov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220718192844.1805158-7-yury.norov@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=BVcx98f4; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf07.hostedemail.com: domain of andriy.shevchenko@linux.intel.com has no SPF policy when checking 192.55.52.115) smtp.mailfrom=andriy.shevchenko@linux.intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658178719; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=CW/++336tIadQt0pwmfP/KxxdKsx6evrXnLyNr32L2E=; b=BjjtAqItJua7G9OTc7qcYvCXL5G39NhZzqzAkUQY1+LRxKNY72/TzcgvOavOA1MhqU+Z73 91Jyr6cxG/eJcJiprzJ4FFv5LEoZR0oijVkk6OPnhIDy9bJ4K2Em/e2smkQOIvFrTH0tlx Xpdm6+wNmyp0Ysrd9IH1OoydSca1pN0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658178719; a=rsa-sha256; cv=none; b=kxD6/h/dL2k+DkQURrFIBPvZ9mrM3H4AgDfQrpZ15Don5Z+1w+yqY8vkw85zuf2YDJ0HgU 8BLqHeb8faugD7n+XXRkDyPc4dJfEVozdk5sN+kTS9HTy8wLXTTtnB+5MaP+teOQUUtXgP BitSkIAoWk66v28x36YGJDuZnUZum4M= X-Stat-Signature: 1erz9beurkm3tggam8kchgqtqjomxggi X-Rspamd-Queue-Id: 162EA4005D X-Rspam-User: Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=BVcx98f4; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf07.hostedemail.com: domain of andriy.shevchenko@linux.intel.com has no SPF policy when checking 192.55.52.115) smtp.mailfrom=andriy.shevchenko@linux.intel.com X-Rspamd-Server: rspam11 X-HE-Tag: 1658178718-45468 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: On Mon, Jul 18, 2022 at 12:28:34PM -0700, Yury Norov wrote: > 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. There are no "useless" tests. Same comments as per a couple of previous patches. -- With Best Regards, Andy Shevchenko