Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755178AbeAJJeX (ORCPT + 1 other); Wed, 10 Jan 2018 04:34:23 -0500 Received: from mail-bn3nam01on0073.outbound.protection.outlook.com ([104.47.33.73]:47744 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752225AbeAJJeU (ORCPT ); Wed, 10 Jan 2018 04:34:20 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; Date: Wed, 10 Jan 2018 12:34:05 +0300 From: Yury Norov To: Andy Shevchenko Cc: Andrew Morton , linux-kernel@vger.kernel.org, Rasmus Villemoes , Randy Dunlap Subject: Re: [PATCH v1 1/4] bitmap: Add bitmap_zero()/bitmap_clear() test cases Message-ID: <20180110093405.zhz3smxy264kmghv@yury-thinkpad> References: <20180109172430.87452-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180109172430.87452-1-andriy.shevchenko@linux.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) X-Originating-IP: [42.107.85.128] X-ClientProxiedBy: DB6PR07CA0024.eurprd07.prod.outlook.com (2603:10a6:6:2d::34) To CY4PR0701MB3828.namprd07.prod.outlook.com (2603:10b6:910:94::34) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36176954-2340-4594-78c0-08d5580d5255 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:CY4PR0701MB3828; X-Microsoft-Exchange-Diagnostics: 1;CY4PR0701MB3828;3:Yvjj5WtH/JGgrgoOzPnQjpg2IYcdAgLzQGqu7veb0aIW3ftCrADbWtnukDAYnl2MpBFMaZxuWEMM6ryW7r1RwD0PWsWyslw2A0uS0vYN+L5S/cUQemCvn2q7uZ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L7reHqNMVlRymU5Wp1pYGhQwnCfNl24XBFC5FXg6VEZyZUF8NdgdxEmUmc6xL6j+8KpRU1YKFALZYyq1F9vZWqvnbWxGyvVBZkTphInlozDl8zl5razh/05cxrT1OVX8MFPh4YiqpD1IsCS4VyXGhwBIIsu1E3HnCRaPKrKsrB/WSs//BLVea28sRoUUna/5skJBbSzuwx8umu+e48UdHFYm0bN4ImpqurwWvD8k0tBy94Swnkm1fFj3F9lNdsyjKFa5RInhRL+vBoPy23pJMxapsdtmC4jHfjY1TvOCJKcDd+TxoeJCfKh6dyJWk1LkNfkGhlPGbDRiiB5cl8=;4:JgQslV74JwgJRRPSvUv8DXS5OJinXc+Pbi6fb6FNeINClm72z8/5NdeQE5mtA2l4NEUs8SYKwWbZwWiExW7r0UKAe2xDUPf0ssY0ixkBrV+DaitsA4M18y7Leh6fb+EFP/t7M8A4phdev3ddesEslMkFwoTY2KVzLh+MH89XCT4O8XWrZCFpVlf7oTgWr0GfQRk93ESnE+YmH62nZuiVLq6EDFfGD+2nSaHKysKL50uXii3pN/JIqE2a+8ibM//g6s+bX1R75KLug1wH2XHqDg372tDdGK+1PTZPuTFs8iNFhw+qbofSLLat/TUhWAEg X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(5005006)(8121501046)(3002001)(3231023)(944501075)(93006095)(10201501046)(6041268)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:CY4PR0701MB3828;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:CY4PR0701MB3828; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(7916004)(396003)(39380400002)(366004)(346002)(39860400002)(376002)(199004)(189003)(24454002)(52116002)(6246003)(305945005)(81156014)(33896004)(25786009)(50466002)(1076002)(3846002)(6116002)(33716001)(58126008)(16586007)(7736002)(81166006)(8676002)(6496006)(76176011)(5660300001)(316002)(23726003)(2906002)(9686003)(76506005)(66066001)(53936002)(47776003)(68736007)(54906003)(16526018)(83506002)(229853002)(4326008)(97736004)(6916009)(42882006)(386003)(8936002)(478600001)(105586002)(5009440100003)(72206003)(6666003)(6486002)(2950100002)(106356001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR0701MB3828;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR0701MB3828;23:cxoAv8EKQv4Xk+2q9qv4p8EyX4Dii+NXH9LLBou?= =?us-ascii?Q?5kFXD+b4ONoOzsNQ5unkH4yR169wxvKxh1o0vORysyCun396Jywc8I6vO4Go?= =?us-ascii?Q?pmElOPZWlwx4y2FWHNB7e6z5AqMx8wN2OzY9Ab1upPDnRLjvMJyrLrL2Oy0J?= =?us-ascii?Q?d9MDEVX3OVxpTB1THSdhHduQBDUqMPWcXruBNGY2rd+fh+TDG3YFEnEN0Rfk?= =?us-ascii?Q?uxcVCwYl73W6fuTIVM0nLi94jFTGn+wbhX5HqqaVzUVjV2sG9q4CiXYU/YEc?= =?us-ascii?Q?JcDK6xznNcXZG3s2mMaWnLi0K5sTzZasBt4Li3DHZuu1GGG3yARXOMc9juIW?= =?us-ascii?Q?JdhFGTA9YbYPDeHDRqE8V4C1R5XgAD2zetZEDMCZmhFjqG3zvhJY6X04goKj?= =?us-ascii?Q?EeAFLPMzHHzkKQjeXjQiIwO9G/orvpi6NRvepV0ZwnemB9q5HT7sJ9tai4a2?= =?us-ascii?Q?3ByrpQxdG/c0HxG7niDGiv+VoPJicu5ZJuBn+D6GD64DjeSv3Wvn0cyvcdXj?= =?us-ascii?Q?WMSrWrlDVdoWhvssK0WSWaDeEEqNA/Ykm7ikRPjzjCw74bpAabqDZbYF525O?= =?us-ascii?Q?qW8zNxJ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w7ZTZOXO56es8Wqj0xp58C9LEQ7flGrjCqoK/Hn10FWHS1SXEhqsSkMnWCZbYu9i06GoVfD0ZQ1Tm8HX8RGk9xedyHfOF7Ihs2YRg8WlVye9KUyS0vWCtjZcxY5aSi9BXfWzcpIPcY3cm/yPwmZ2v59kZIFVN8e40drZsVzI0lGa/u45Pz0Khradr8oW9hZCNv6Ox2mMDEtr8jtU0an9cQsuK/TZ7spUiZylJaZJsGNaU=;5:tUZcTwkISc07reS4rrldmbX6GZP+DGVO6+igB1PRvRhnwzh7uDQTfvHLjMCUVw3RSyvgRT2q/aUYcVU3Ol8ojXyZfdotdYh9yEUuUSKiLQc1FS4RDhKjGKlABT9XRgi9ztVK4yulmAAD+v9P4npbspVlftEZENdf/KtVhcPjT0M=;24:w3NQdHIU5aP83Ixf7TlMJER8kexr9/PZobWzCtdeBBTckEx+Ft5yo6+iQcoFxeCw+CLUjsMIli4q48K+yU11iXpCDMd4vyA4eRO50L28+i0=;7:UlqvR74mt3JHr+lb8zKC7BpTOFbI3Nh2cUCpZ7Zqz3Lu7dR7pf7dwESjr/HqNn8TJRC6Ric8K2Dq6+PQZJK5bclSjESa7ooqxvLslNqCFuKNU9vtL6i+6ot5EOknaaoRK0ILQ4insnu3GVWVHsaSUeyzL4jzDRFVRzMtFPC4e3ykZt8x8BD+3igpC8Rj2Fo8D4GKsNCj6s22HOZl+9oejYcri+mcqQeipR/vnhpCgyhF07Bqq5zNdEMKFkdCWx2e SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 09:34:17.4289 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36176954-2340-4594-78c0-08d5580d5255 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0701MB3828 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hi Andy, On Tue, Jan 09, 2018 at 07:24:27PM +0200, Andy Shevchenko wrote: > Explicitly test bitmap_zero() and bitmap_clear() functions. > > Signed-off-by: Andy Shevchenko > --- > lib/test_bitmap.c | 30 ++++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c > index de7ef2996a07..9734af711816 100644 > --- a/lib/test_bitmap.c > +++ b/lib/test_bitmap.c > @@ -105,6 +105,35 @@ __check_eq_u32_array(const char *srcfile, unsigned int line, > #define expect_eq_pbl(...) __expect_eq(pbl, ##__VA_ARGS__) > #define expect_eq_u32_array(...) __expect_eq(u32_array, ##__VA_ARGS__) > > +static void __init test_zero_clear(void) > +{ > + DECLARE_BITMAP(bmap, 1024); > + > + /* Known way to set all bits */ Nit: if you start your comments with capital, proceed that way till the end. > + memset(bmap, 0xff, 128); > + > + expect_eq_pbl("0-22", bmap, 23); > + expect_eq_pbl("0-1023", bmap, 1024); > + > + /* single-word bitmaps */ > + bitmap_clear(bmap, 0, 9); > + expect_eq_pbl("9-1023", bmap, 1024); > + > + bitmap_zero(bmap, 35); > + expect_eq_pbl("64-1023", bmap, 1024); > + > + /* cross boundaries operations */ > + bitmap_clear(bmap, 79, 19); > + expect_eq_pbl("64-78,98-1023", bmap, 1024); > + > + bitmap_zero(bmap, 115); > + expect_eq_pbl("128-1023", bmap, 1024); > + > + /* Zeroing entire area */ > + bitmap_zero(bmap, 1024); > + expect_eq_pbl("", bmap, 1024); > +} > + > static void __init test_zero_fill_copy(void) > { > DECLARE_BITMAP(bmap1, 1024); > @@ -309,6 +338,7 @@ static void noinline __init test_mem_optimisations(void) > > static int __init test_bitmap_init(void) > { > + test_zero_clear(); > test_zero_fill_copy(); > test_bitmap_arr32(); > test_bitmap_parselist(); I don't understand what patch #4 is doing in this series. At the first glance, it may be applied separately. The rest is looking fine. For 1-3, Reviewed-by: Yury Norov