Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4653270imm; Mon, 14 May 2018 10:36:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo4qUjqnppYC+RDrzLpx+7H4uKGMJuOpoahqj2B5L66vQ1Vp0tJGboNvLuhXK+G7hO24SZk X-Received: by 2002:a65:560f:: with SMTP id l15-v6mr9008658pgs.186.1526319361948; Mon, 14 May 2018 10:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526319361; cv=none; d=google.com; s=arc-20160816; b=V5qVpGRcI0JQHRiH49oNsMqjq9pSXm133txj6/66Vm3zqHGqAB6zVAgor+p6xpFtv0 1PePIqNBX+fUrm/yUjL5SkR5D6YHcwUpXZfVRFHfFWpNiDvx2GVwkBxLq/e9ma7bXH5Q hnOCIfB81vx36jQXU/w9fQzTL+XUNEPeUv3TMPqwBL6fhRnxd1JZJhPKlnmxziQfodLd xmiH4BHhkDDmx6DqI64B0ou0hNOhS87SpjmdwN9ozrwlpDy9HnYtiSW8jcnD/tTOytA/ nUzcl9RcmIAX2OVmtpgLejpmntcG7GUDzPdCiB3bumMcOy5V1+LVTDnnAGYz+NRyfwbE 3bXw== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=5uUhHOTBxCgBzDJWJ4JGKGmy/sdI4SEw+ukmAY3OJMU=; b=UMd6war/Ong8UBlaInYIixIZWONV9r3x9u1G1r5gbzTdfzIR3Z399U6fKj3971C1fj x2g2Hr6pZXF5+vXftOsgWZnNKIdY8ApeecskW4V1COeUM+zA1VQww27HNx571RExmDZj ZeC2BH19I766CURHQFPVC9b/mUMAB1nSrft7SX/Ru/ctD2nEVKfqhXk9+BtZFnaYJtC8 D5MJ760tdhus3/DsO84b/XEjkP7+we3RMRmHPnKoaChjkC+yNpSkeHHpJ9uRq8gn9iHB Fdldsna/1zsfQZUT60y9hD4SYLIaflIct52QaZwz5COQ8Im4xRYKBGFHZZGoIoYgO49s RONQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XeKzepZp; 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 bh5-v6si9228095plb.320.2018.05.14.10.35.47; Mon, 14 May 2018 10:36:01 -0700 (PDT) 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=XeKzepZp; 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 S1753412AbeENRIL (ORCPT + 99 others); Mon, 14 May 2018 13:08:11 -0400 Received: from mail-qk0-f175.google.com ([209.85.220.175]:34725 "EHLO mail-qk0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752260AbeENRII (ORCPT ); Mon, 14 May 2018 13:08:08 -0400 Received: by mail-qk0-f175.google.com with SMTP id p186-v6so10612342qkd.1; Mon, 14 May 2018 10:08:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=5uUhHOTBxCgBzDJWJ4JGKGmy/sdI4SEw+ukmAY3OJMU=; b=XeKzepZp0I3mkWoEAja1PoaJ76yOIcUmoTko0AKwBQ41hhOioxXS/3JySTs8YhwBdV ICQ09lqR+wAzXNGfr4/qkP5zYrtNzJiIHRMqFQKyF0mbrjThl7uiM+cf6u8KuA36MmCU RfdAVB7pKr9Y6+DJ3nCdPNQ8bCPlxThslkXRdHKM8lFtnVnAj8zMxa4opdrKoHFZz5QG kAOPA6FaTh1M/64/3axBwQFM88Gf8zUg0s0fHnC/CGre/KRuBiHr9lEBEbSu196mYq6r qIza9C2d3FK5EyCYo8BoNT4EhBh567LQUZoY/Z3ss2O1gsOQXOi1XKKOQJXWp2NYAbQl k/Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=5uUhHOTBxCgBzDJWJ4JGKGmy/sdI4SEw+ukmAY3OJMU=; b=uabKDOhS1VLzROZ//e6d0cROGqDMcECUveA6mY/COTfO6mGMJlZrwO8jyOY7si3FOF MIsOxLEVN7day8JWZc9zYcnD6kL869nXzZs8d8yBgilux80WneuzojxWkErsKn83cSl5 iL2+aBr7/1dd4zgoYaWSVjOrOMix3Dfa74UrWYqbnJCDNgRPcUBQ7zKh39IzZhwaSAPz 1W3uof/959AF41tTMW3YuMgukRDK71X/al4bP9XM65j56ftzwMwhEyepRGxhNPNWo4+0 /uN3b7McXgptW+rSWjObrcF23UJUp2mwWa+qgXUMZamyXEuViOZYXH5nw4FdWyFDXIVk HSAA== X-Gm-Message-State: ALKqPwdlKHVyIt+9Myeq4qDr6jHR1S4CG4sApdLGUbYP83BmjL72Si7c 5UNiKE8TqDNBFSlbn9UyRNIVez4oAPKBebvGImo= X-Received: by 2002:a37:d1d3:: with SMTP id o80-v6mr9197740qkl.3.1526317687551; Mon, 14 May 2018 10:08:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.152.150 with HTTP; Mon, 14 May 2018 10:08:06 -0700 (PDT) In-Reply-To: <20180514130438.GB20325@sophia> References: <20180514130438.GB20325@sophia> From: Andy Shevchenko Date: Mon, 14 May 2018 20:08:06 +0300 Message-ID: Subject: Re: [PATCH v2 1/7] bitops: Introduce the for_each_set_port_word macro To: William Breathitt Gray Cc: Linus Walleij , "open list:GPIO SUBSYSTEM" , Linux-Arch , Linux Kernel Mailing List , 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 Mon, May 14, 2018 at 4:04 PM, William Breathitt Gray wrote: > On Sun, May 13, 2018 at 06:06:42PM +0300, Andy Shevchenko wrote: >>On Tue, May 8, 2018 at 4:26 PM, William Breathitt Gray >> wrote: >>> This macro iterates for each group of bits (port word) with set bits, >>> within a bitmap memory region. For each iteration, "port_word" is set to >>> the found port word index, "word_index" is set to the word index of the >>> bitmap containing the found port word, and "word_offset" is set to the >>> bit offset of the found port word within the respective bitmap word. >> >>Isn't that idea we discussed some time ago? > > That's right, I found the time to implement the macro suggestion you > made during the get_multiple/set_multiple patchset for the PC104 GPIO > drivers a while ago. So, if you find it appropriate, please add Suggested-by. > This macro greatly simplifies the callback function implementations in > those drivers and reduces the repeated code that kept appearing among > those drivers. Hopefully it can be useful for other drivers as well. Yes, I like the idea! >>In any case, part "port" is too specific for a generic function like >>this. Please, get rid of it completely. No-one knows what port means >>here. Just makes a lot of confusion. > > Okay, I'll come up with a better name and submit a version 3 of this > patchset. I also forgot to mention that kernel-doc should accompany function definition (in *.c), and not a declaration (in *.h). -- With Best Regards, Andy Shevchenko