Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2678078rdh; Wed, 27 Sep 2023 09:23:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHktUAjhnxv6JodGzxmRIp/sF2slureOViayxYiKvYR56JhtCnMzakvsKr9uIf40HLXh4Ee X-Received: by 2002:a05:6a20:7daa:b0:158:143d:e215 with SMTP id v42-20020a056a207daa00b00158143de215mr9975466pzj.1.1695831831243; Wed, 27 Sep 2023 09:23:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695831831; cv=none; d=google.com; s=arc-20160816; b=EZDGEbGUyMBzrz8F8+ZZFzEty+tVyJnSH5iU81LXzHRZs34Jt77bZ+5HUKNkO8Rnl7 xZoGXaMcbYPMlhmlrGqFnq1EHs06/kN0UEqJmluOAtd/f6cwG/GYvfIrB6WkuOzAU4cI Zf+kx9o0B17jKoIS6UDU8AxRUM/F04Pxz0/+DY81UvlpdLGpkU/e0TxxGifjSEezh6ta GRCBO8Ry/CTf3QLkVt6poBfapBhTDQhqMTvcX1Bfp4cCU2uXuBkpBZKCZg1H5tIFpr4c 9cLVHSVDzt1kDImKa0QvK09i9I0qfQdCrQ6xfFXoVF4Ks1j/xrtD6bFjoLJuZ8L4w2fC D5Qg== 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 :dkim-signature; bh=w9risxM4Kj2vckjgJ1AYP1/3B08xjsY8qLXlA994648=; fh=UHpi0mWO8Pq5Bag+v19BTFUUAWWXhz7peZnBe+BgdPg=; b=qBYTr6Wr1iQG42Fg/nT7ruYqjsZh2yjUmZPXOKZHuEVc3RgHmH+jkJkeNT51StzlcG cNJsa6mi+zz3eo+7tSGN5PGo2RxrKuIV1tmtYtqRmj0GevRq4myrHjT5OFZrCkpW2bpU 3M5QhuSLkceU0ZqWzEqSO6xCImG4pu/Enfby9WVy3LD+M7UXUmJdZihNkaEi5lhAuYNb 9JIwrRcqhXyCotuKRZsIbKgKGU7Sxae0j5J/mVoE2HKSMt2QfNdYVkhXh89VcnHUG8ju 9ByWZjiLfDu1vHruj3mbB+kPidRQOif1lSG/O7AB7x0xqBwUuwnc3REboaV3kN/mnM0f 70EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=C0i4X3rO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id j70-20020a638049000000b005777535a67bsi16306114pgd.746.2023.09.27.09.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 09:23:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=C0i4X3rO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1EA968067B5F; Wed, 27 Sep 2023 05:11:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231547AbjI0MLY (ORCPT + 99 others); Wed, 27 Sep 2023 08:11:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231169AbjI0MLW (ORCPT ); Wed, 27 Sep 2023 08:11:22 -0400 X-Greylist: delayed 61 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 27 Sep 2023 05:11:21 PDT Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B563D139; Wed, 27 Sep 2023 05:11:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695816682; x=1727352682; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=4vQe1q4hMJ3hNkO7sxKc4Crn7sjhVzAnB6hHM6cKjoI=; b=C0i4X3rOPrfUc3jcwuFpFMfYYRmBemCZfhMfKrs5nxgqZdPN/ZxNciix MzgDLl9/cho0tPp3ZtDw9dzS022sQr803ZluYi1PLiPI567+NLWyIl2w+ Hn89GBo2O/sjZowO0UEtr4kF6E06MK0173DKCqjmeJ7QlwNBzGmwfv11p 348vgeHEWTmMng6bofEIpqf+t8Hi/5BKhZIHj4jEl7Iy0HAIuAS1rWUal DuH+cYAfEaT69wWUI+CptfA1/fawmi5CPW/60rAnauLwaa6i0l/w5GyOU iLpHWHot1H1Tx93aAAY+0CuzJ84LhmN6yJYnEhP4FMDTS4EGiggS2GncF Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10845"; a="404480" X-IronPort-AV: E=Sophos;i="6.03,181,1694761200"; d="scan'208";a="404480" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2023 05:10:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10845"; a="725781465" X-IronPort-AV: E=Sophos;i="6.03,181,1694761200"; d="scan'208";a="725781465" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga006.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2023 05:10:17 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC0) (envelope-from ) id 1qlTMs-00000000sW0-0brW; Wed, 27 Sep 2023 15:10:14 +0300 Date: Wed, 27 Sep 2023 15:10:13 +0300 From: Andy Shevchenko To: Yury Norov Cc: Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Shubhrajyoti Datta , Srinivas Neeli , Michal Simek , Bartosz Golaszewski , Rasmus Villemoes , Marek =?iso-8859-1?Q?Beh=FAn?= Subject: Re: [PATCH v1 2/5] lib/bitmap: Introduce bitmap_scatter() and bitmap_gather() helpers Message-ID: References: <20230926052007.3917389-1-andriy.shevchenko@linux.intel.com> <20230926052007.3917389-3-andriy.shevchenko@linux.intel.com> 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 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 27 Sep 2023 05:11:29 -0700 (PDT) On Tue, Sep 26, 2023 at 07:10:33PM -0700, Yury Norov wrote: ... > So, if mask is 0b01, and src is 0b10, the output will be 0b00. Correct. This how it must work. > To me it sounds like you've gathered nothing, while the intention > was to gather all source bits to bit #0. No, the idea is to gather bits positions of which are provided by a mask from source to a destination, where the positions are sequential. > This is my understanding > of the word 'gather', You should get the mask meaning. It's not the bit provider, it's a bit positions provider. > and this is how bitmap_remap() works. It's NOT a replacement of bitmap_remap(). It's specifically written in the commit message that domain of these APIs is when @old or @new (in case of bitmap_remap() API) equals 2^n - 1, where n is amount of bits we consider. ... > If you claim you're replacing bitmap_remap(), > you should correctly handle > the above case; when src == dst; when mask is empty, and probably more... I don't care about corner cases of bitmap_remap(), and we can solve the issue when it comes. Currently there is no issue with the all users that need these API as they use different addresses. -- With Best Regards, Andy Shevchenko