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 X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D1B2C4363D for ; Mon, 5 Oct 2020 09:35:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DCABB2078E for ; Mon, 5 Oct 2020 09:35:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726060AbgJEJfr (ORCPT ); Mon, 5 Oct 2020 05:35:47 -0400 Received: from mga12.intel.com ([192.55.52.136]:50803 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725996AbgJEJfq (ORCPT ); Mon, 5 Oct 2020 05:35:46 -0400 IronPort-SDR: qQ9DiyjycTSqqTnDHuTj9pZgHTVrQTFqcQ90az9JCKGFP3HnbBR84e26vl2rYHDMnCVeDsWJnN MTbWKoHJkemg== X-IronPort-AV: E=McAfee;i="6000,8403,9764"; a="142755581" X-IronPort-AV: E=Sophos;i="5.77,338,1596524400"; d="scan'208";a="142755581" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2020 02:35:45 -0700 IronPort-SDR: bz6AhyrVwio06dKoiKbmdtFKhE2a4F1NB0oI4T/AlXgityM+kZs4N5M4uC8ldNGgSXZN7v/RIv 5yGORhHys56Q== X-IronPort-AV: E=Sophos;i="5.77,338,1596524400"; d="scan'208";a="516663355" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2020 02:35:44 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kPMuA-004aFA-Vi; Mon, 05 Oct 2020 12:35:38 +0300 Date: Mon, 5 Oct 2020 12:35:38 +0300 From: Andy Shevchenko To: Syed Nayyar Waris Cc: William Breathitt Gray , Linus Walleij , Andrew Morton , Arnd Bergmann , Linux-Arch , Linux Kernel Mailing List Subject: Re: [PATCH v10 1/4] bitops: Introduce the for_each_set_clump macro Message-ID: <20201005093538.GM3956970@smile.fi.intel.com> References: <20201003125626.GA3732@shinobu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 03, 2020 at 08:38:14PM +0530, Syed Nayyar Waris wrote: > On Sat, Oct 3, 2020 at 6:32 PM Andy Shevchenko > wrote: > > On Sat, Oct 3, 2020 at 3:56 PM William Breathitt Gray > > wrote: > > > On Sat, Oct 03, 2020 at 03:45:04PM +0300, Andy Shevchenko wrote: > > > > On Sat, Oct 3, 2020 at 2:37 PM Syed Nayyar Waris wrote: > > > > > On Sat, Oct 3, 2020 at 2:14 PM Andy Shevchenko > > > > > wrote: > > > > > > On Sat, Oct 3, 2020 at 2:51 AM Syed Nayyar Waris wrote: ... > > > > > > > + map[index] &= ~BITMAP_FIRST_WORD_MASK(start); > > > > > > > + map[index] |= value << offset; > > > > > > > > Side note: I would prefer + 0 here and there, but it's up to you. > > Andy what do you mean by the above statement, can you please clarify? > Can you please elaborate on the above statement. Sure. I meant something like map[index + 0] &= ~BITMAP_FIRST_WORD_MASK(start); map[index + 0] |= value << offset; > > > > > > > + map[index + 1] &= ~BITMAP_LAST_WORD_MASK(start + nbits); > > > > > > > + map[index + 1] |= (value >> space); -- With Best Regards, Andy Shevchenko