Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5754310imb; Fri, 8 Mar 2019 01:20:04 -0800 (PST) X-Google-Smtp-Source: APXvYqxp5ggEdwy6oRmiRj8PTHsCHzbJJrgX4xT6XE7+EHZO8uGQpIQnKh6W2SJ6aPAn26q3/sa8 X-Received: by 2002:a17:902:728f:: with SMTP id d15mr17851885pll.156.1552036804592; Fri, 08 Mar 2019 01:20:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552036804; cv=none; d=google.com; s=arc-20160816; b=ZKUKNzohjiO4TsvdQZwOnS0a61oifFp88WXAX8KY0dUCqN2QGqb2H5cU9EtM+jOlgh 2wfxjKTsF/WeeC+2fqcBInqNe3nIiMMXI1cueE4IptkvWa3UsnU5JJu000AbXsXVBQnR 0jtSasaKuJmjjXsPGlFCzvWsDI1dpN65dB72TQk1hMAQwNg7mmg/KdsubrHvhlWvTj24 kZBudxZQTcZ06KRY75SZjgi3dUV+/U95GdyDZ2I3KRjkWvXTD3yt44kVSp2nOr9kfjsR r5dqai+AQe53XpZM+LgwJDMt7ymxSHfeCKuMS21nNYjig6dHwHMYGZD8Bfz6dgBkBPw7 hrtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=d6G9aoVRcA2Mn1faj5vBVt9zIStu9ypTtyKPwsoNBDc=; b=nw+p0iuRAWqly1HJmgYb5leh/inVn6IgJ/MFaRy9qkKQI+PyDpAHnR7R0Kk5PjXvBY im+Ax77sjFKn8VqJLEcgu63LjMh2axgqG8CDrQJcl3/Xkj0zMFZlMnS9HbwDWHw8Mg2x A6btb5K6anQUWTfL6ODm7ENmM+x3kVb6UtrAcGlALNk63nv+ajmQc0KSQsWWJ1pSMSiu OAojG8pXfWzCRlIqCJvRbN8pkc7VjLSwthAMYyh1CJDLnfTJdffxVuvgyDOToBxiIM4z 87s8PVbfUXV7blpURD/8xkYJlAcycbPKqRf9JI7rsU8XwRRWN7SlFmnu+sSWO9o5j/mq hW1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=o+90rphf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x20si6242332pfm.282.2019.03.08.01.19.49; Fri, 08 Mar 2019 01:20:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=o+90rphf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726367AbfCHJTa (ORCPT + 99 others); Fri, 8 Mar 2019 04:19:30 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:37429 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726307AbfCHJT3 (ORCPT ); Fri, 8 Mar 2019 04:19:29 -0500 Received: by mail-pf1-f194.google.com with SMTP id s22so13714505pfh.4; Fri, 08 Mar 2019 01:19:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=d6G9aoVRcA2Mn1faj5vBVt9zIStu9ypTtyKPwsoNBDc=; b=o+90rphffLe0ixbSWlSiMVaWducoNShSBfeaWlf1I8tSKfQGbiX3ioXWPQyLvz6lju +GRM5EdgKiXSdpEShqxUsbxIEosuRyzRgGg3bNToO6EfsT/jNW8axv4Hm98eNpRqy7lH ghIxEGl1JQls4OwW1EDbLsZcIvcmcMGRxUFRZihwSJ8Qj3ZiEJ3dNt1R5hJ6fCdnMY9z KxplaYllZfaBrLHv4A/w78mtqieDFqukTWhuUwIt8KoABJvRfrYHMjjNU86OyjlxL6Cy TH3wfWKiNotJFtbpAF6Y/PMX/uHxRTA49i1gGodqO6pKkznXNs+fslbwiuow0WFscDOe pLpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=d6G9aoVRcA2Mn1faj5vBVt9zIStu9ypTtyKPwsoNBDc=; b=hWz/0AiQzy8nc87tk9ryvpqDOa/OWr1Yz3bAfnVfM88adisFVncUZH4ygd2cAKNOvc mUjVAL45dhSn3Bl+yNRLjFOKNFxtRzSuDIYBb6MdcB3CNRCF74Vtgk9M25EFk+U2X+Ey vssGpI8OX0CK35iB8UliK3nYssny2NUbSMKCU2cAfK8pkkWcUWCaKva7yKHeH3GFcKWB bQo3kvgDaMF2sSDmFEdlY072Bj7zkjuGNsD8hM5go80GMl1gdSUZW14VhPmZTC+m5mYO clfrMOllxaJINkUEdgaeqosXsPPbH/8Wj1qGWKuPhRRQC4kiIZZKyF5Lx4uN8uJYqkKP TXQA== X-Gm-Message-State: APjAAAU5yHw9NO3ISjYzxNYB2YmehEwbr3sIYInMWFn7ehAcP5nIX/qL TqSgvAfd1PdJyJRBzMFPKpENuJRw2jYmibJ8j9g= X-Received: by 2002:a17:902:728d:: with SMTP id d13mr17913086pll.12.1552036768074; Fri, 08 Mar 2019 01:19:28 -0800 (PST) MIME-Version: 1.0 References: <12b3a364ac7fc32194fa6f55911dd800aca92a56.1551598603.git.vilhelm.gray@gmail.com> <20190308085733.GA3903@icarus> In-Reply-To: <20190308085733.GA3903@icarus> From: Andy Shevchenko Date: Fri, 8 Mar 2019 11:19:16 +0200 Message-ID: Subject: Re: [PATCH v9 1/9] bitops: Introduce the for_each_set_clump8 macro To: William Breathitt Gray Cc: Linus Walleij , Andrew Morton , "open list:GPIO SUBSYSTEM" , Linux-Arch , "linux-kernel@vger.kernel.org" , Andy Shevchenko , Rasmus Villemoes , Masahiro Yamada , Bartosz Golaszewski , Linux ARM , Arnd Bergmann Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 8, 2019 at 10:56 AM William Breathitt Gray wrote: > On Fri, Mar 08, 2019 at 09:31:00AM +0100, Linus Walleij wrote: > > On Sun, Mar 3, 2019 at 8:47 AM William Breathitt Gray > > wrote: > > > > > This macro iterates for each 8-bit group of bits (clump) with set bits, > > > within a bitmap memory region. For each iteration, "start" is set to the > > > bit offset of the found clump, while the respective clump value is > > > stored to the location pointed by "clump". Additionally, the > > > bitmap_get_value8 and bitmap_set_value8 functions are introduced to > > > respectively get and set an 8-bit value in a bitmap memory region. > > Andrew: would you be OK with this being merged in v5.1? > > > > If we need to move the code to drivers/gpio that's OK (though > > I think it's generally useful) but I need to know to proceed with > > the William's nice optimization of these drivers. > > > > Yours, > > Linus Walleij > > I was waiting on Andy to suggest some examples out of the GPIO realm, > but he may be under a heavy workload right Yeah, sorry for that. I will use your helpers in the future for sure in the suitable parts of the code inside and outside of GPIO, just not in a highest priority to me. > so I decided to do a quick > Consider this, if I am able to find a use for this macro outside of the > GPIO subsystem within a matter minutes, then there must be some benefit > in allowing the rest of the kernel to use the for_each_set_clump8 macro. > So let's put it in bitops.h rather than restrict it to just the GPIO > subsystem. As I mentioned earlier I'm pretty sure I found as well opportunity to use this new API outside of GPIO realm. I just want to be sure (means of testing on real HW). -- With Best Regards, Andy Shevchenko