Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3159361pxk; Mon, 5 Oct 2020 02:39:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy41T40oz/ao5AoviUhkPYQmtw99IpHIEYTcljjuAU4je4nggwpjUN3ujxruQ/bxEKD7SOl X-Received: by 2002:a17:906:22c1:: with SMTP id q1mr14038020eja.529.1601890750382; Mon, 05 Oct 2020 02:39:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601890750; cv=none; d=google.com; s=arc-20160816; b=1JY3T7741i2uYaCCA5nq45P9Ov8Ak49Vxq9Pox/fKcONjZRbn2I1DDBrarqNnGhSJU WukBJQaP0qTVeAAmG4us0dJsjPo0n9kSNZLCEJBGLSQVNmRJSREmvg5/lJMLoGz8aU1+ eOHM6WpsYIMyd/yGjGbdvm8i1fghgdvSX2QKds+xrmgfFGoRlYEsZZXClbBPg7RglggG kbNke3FcAQZaAvbtrcgonO+uK3Ht0wdhH6hnnvrnD0LeQ15UUlpNkrV9I88RJ9tsZMVD vYhFZ90Hbumd4weSnqe+a33BlHiRV3FPqzFLWeYZ6Xx61VHnidvYKybTjd8wQHE9lC/P fyew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=Xq+WXOoCJSkHhi36gjvFEfXesED8qR2PYwVo8k4Z2No=; b=IxU16T0TLf6N5oaJHdYY2xyolsDQumnZ3Kg0qLRkiZ1Y5dq7FWTY/YkWW0U1ZGoFHZ P4cXnuygvgzWQlMw3iuKaJBwybriQAkcuVVDTq6mQo5BEVzbZirNGtVDBzRNUgaT0f9s Rylw7Y6haQkNhJwPlh3ITBseKW2FXPwmCT95WEJH5fyzbc1Rsncb9jSfKNxCn8H3VWOk iEx53HXIahvCa5HsFGlUeyBDowUHlvYMApWlXdI4dfTiyog9FadBQV/I+DSuPxD8MSdn XCsn7arqp3sKKEyx+2yDBo15jhHIClQgW1C0ZlKeCqJPU3VCvRdg6znPrpcHEftsAhv5 u+mw== 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lh27si2522162ejb.698.2020.10.05.02.38.47; Mon, 05 Oct 2020 02:39:10 -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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726012AbgJEJfr (ORCPT + 99 others); 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