Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp452569ybz; Wed, 29 Apr 2020 03:18:55 -0700 (PDT) X-Google-Smtp-Source: APiQypL2jDy5XZd8i33rI9fC4KtQHy1yj9rp2flA+nQ6B4/oZ/u56lsjTWe9DpPcexKuWZnpYPPH X-Received: by 2002:a05:6402:17f1:: with SMTP id t17mr1716196edy.239.1588155535774; Wed, 29 Apr 2020 03:18:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588155535; cv=none; d=google.com; s=arc-20160816; b=HRctCLvjLKndUZyDmIwHU+yM33GfMkjpczvqcBp2EGemd9eVxVi78LIV3WWBeFVVRj lZ73v4fUHRjsuNz77QdqrNrR3NUiRWkobV4wlsmrnBgme3+ApkynkLAWxIDH9tq3I9U3 ShOqUu4s2KZq0Vd+B9b9ivRirFkx5RStDKulZLawt29B6ZrnHjq/Tx2HyTER7hW/JiWG izkRtsZeQf/XULL/8qzJD4RlYeWvKyyJV/2m6YLw+71jzRAHf6BkF8TA/vmRjw3dKHRU Do7Jrm273Ui/RpudlNJPyVCJhChqHr2qQd4B1urn5IxuF53Pfk5V7Z3S/vlneBAqJm/M 2Thg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=vBnSSkJ/YLcuX9fBXPOr9LYIWN17JhCnS/kNAn3pD5U=; b=Bwj3Bt0FPfrOeQZ6Kc79zNiUzOCqe/E9hbnJXwBG/OpyVuYrP7aoVbFJ0YYZOzqANC cPYLHSS5bbPqSyx9KeEHTiVLVBSq7Bj1QCAisyNff10AYT1bXey+4msHrJxwn18wKyCz znGAT1D4jMNo84jFDEa2mEIBpuTY8+x9ELYBHg+GWs1PHNq8J69SBxrCAxeG70MNsPSz tqHbMdg5ASnB5c14CDJ/8YzqSfCul6oDXF3LtOGSgKn56nHPdGqsc4ZQirQWWz/QSSUg oiM9B4HmEMDbET8pwlzudyqCIe04WYTWcU8oWI1wAtMFfOSRMgmBGLZzV//ppLUVwoxm BLCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y24si3777902ejr.132.2020.04.29.03.18.32; Wed, 29 Apr 2020 03:18:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726692AbgD2KQ1 (ORCPT + 99 others); Wed, 29 Apr 2020 06:16:27 -0400 Received: from mga01.intel.com ([192.55.52.88]:23799 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726526AbgD2KQ0 (ORCPT ); Wed, 29 Apr 2020 06:16:26 -0400 IronPort-SDR: S0tlMSvjxlAN/dvKaU8teQdUqN2tV2Fac7W47Kq2Md5ZP1ZIQZSt9Y41kibpq3HzOtssDwnpCi FYIGciF87Wgw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 03:16:25 -0700 IronPort-SDR: ngckBcLrKNJFRp8xmTszNq8Xur4yS1Mm54nHARqiJhCoUke7GLa0SK7o2I+riwHxLGqgZHxR9h PGBBxZ9r9Tow== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,331,1583222400"; d="scan'208";a="302959240" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by FMSMGA003.fm.intel.com with ESMTP; 29 Apr 2020 03:16:24 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jTjlT-003htc-Ne; Wed, 29 Apr 2020 13:16:27 +0300 Date: Wed, 29 Apr 2020 13:16:27 +0300 From: Andy Shevchenko To: Syed Nayyar Waris Cc: akpm@linux-foundation.org, vilhelm.gray@gmail.com, linus.walleij@linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/4] lib/test_bitmap.c: Add for_each_set_clump test cases Message-ID: <20200429101627.GD185537@smile.fi.intel.com> References: <46108644a1cc2750e281c33fd0efe99bd57c50e2.1588112715.git.syednwaris@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46108644a1cc2750e281c33fd0efe99bd57c50e2.1588112715.git.syednwaris@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 29, 2020 at 04:35:58AM +0530, Syed Nayyar Waris wrote: > The introduction of the generic for_each_set_clump macro need test > cases to verify the implementation. This patch adds test cases for > scenarios in which clump sizes are 8 bits, 24 bits, 30 bits and 6 bits. > The cases contain situations where clump is getting split at the word > boundary and also when zeroes are present in the start and middle of > bitmap. ... > +static void __init test_for_each_set_clump(void) > +{ > + /* common bitmap of max size for different tests */ > + DECLARE_BITMAP(bits, 256); > + > + /* set bitmap for test case 1 with clump size as 8 bits */ > + bitmap_set_value(bits, 0x38000201, 0, 32); > + bitmap_set_value(bits, 0x05ff0f38, 32, 32); > + > + execute_for_each_set_clump(bits, 64, clump_exp1, 8); > + > + /* set bitmap for test case 2 with clump size as 24 bits */ > + bitmap_set_value(bits, 0xeffedcba, 0, 32); > + bitmap_set_value(bits, 0xbbbbabcd, 32, 32); > + bitmap_set_value(bits, 0x000000aa, 64, 32); > + bitmap_set_value(bits, 0x000000aa, 96, 32); > + bitmap_set_value(bits, 0x00ff0000, 128, 32); > + bitmap_set_value(bits, 0xaaaaaa00, 160, 32); > + bitmap_set_value(bits, 0xff000000, 192, 32); > + bitmap_set_value(bits, 0x00aa0000, 224, 32); > + > + execute_for_each_set_clump(bits, 240, clump_exp2, 24); > + > + /* set bitmap for test case 3 with clump size as 30 bits */ > + bitmap_set_value(bits, 0x00000000, 0, 32); > + bitmap_set_value(bits, 0x00000000, 32, 32); > + bitmap_set_value(bits, 0x00000000, 64, 32); > + bitmap_set_value(bits, 0x0f000000, 96, 32); > + > + execute_for_each_set_clump(bits, 240, clump_exp3, 30); > + > + /* set bitmap for test case 4 with clump size as 6 bits */ > + bitmap_set_value(bits, 0x00000ac0, 0, 32); > + execute_for_each_set_clump(bits, 18, clump_exp4, 6); You can roll entire function into one loop for i in ARRAY(test_data_configuration): prepare_test_data() execute_test() > +} -- With Best Regards, Andy Shevchenko