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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E723ACCA47F for ; Mon, 18 Jul 2022 21:12:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233851AbiGRVMA (ORCPT ); Mon, 18 Jul 2022 17:12:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233817AbiGRVL7 (ORCPT ); Mon, 18 Jul 2022 17:11:59 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C88A31DD8; Mon, 18 Jul 2022 14:11:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658178718; x=1689714718; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=B8FiBLFp5csoUvFgk1WR/dfs+8dLITXSfuetGEHiUoY=; b=CEB2EwYfH7GxYV40MJKQETf1mxGKLaW4O4FSayfCf4MjpDgqKE8PEbBQ JbqOhvVEE+XlI1LlkL5EJdN+QDk+m2IefH3FLjPTsaR17pFFXy/8x3phX gK2YV3Dx1o07PGEujgvmEc5a1b4csz9BzdI75ynV4E2KLhenpocdIswFK bAg0VB3Ox4/ITmnU0l0kqzVkgbRTi9ZE5rUW5OreH2HBza3Q5EoujWNRc XZrAHrsKO8KoajaQarJqBv+6LOdlFnLVahsC4ZKahA1UzmrdWoI4xIoiw fT0q5+dWHJvIWDctfpxulclt/U+DKWKJStk/UzvkanyoYO5tm3J3wEFxH A==; X-IronPort-AV: E=McAfee;i="6400,9594,10412"; a="350284486" X-IronPort-AV: E=Sophos;i="5.92,282,1650956400"; d="scan'208";a="350284486" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.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 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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