LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: William Breathitt Gray <vilhelm.gray@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Linux-Arch <linux-arch@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v2 1/7] bitops: Introduce the for_each_set_port_word macro
Date: Mon, 14 May 2018 09:04:38 -0400	[thread overview]
Message-ID: <20180514130438.GB20325@sophia> (raw)
In-Reply-To: <CAHp75VdBL-K2H9tXAG2wPefCdpv913dbJOvvEkOXE7r=+2+NYQ@mail.gmail.com>

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
><vilhelm.gray@gmail.com> 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.

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.

>
>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.

>
>> --- a/lib/find_bit.c
>> +++ b/lib/find_bit.c
>> @@ -20,6 +20,7 @@
>>  #include <linux/bitmap.h>
>>  #include <linux/export.h>
>>  #include <linux/kernel.h>
>
>> +#include <linux/types.h>
>
>No need. It's included by bitmap.h IIRC.

Ah, you are correct, I'll remove this line then.

William Breathitt Gray

>
>
>-- 
>With Best Regards,
>Andy Shevchenko

  reply	other threads:[~2018-05-14 13:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-08 13:26 [PATCH v2 0/7] " William Breathitt Gray
2018-05-08 13:26 ` [PATCH v2 1/7] bitops: " William Breathitt Gray
2018-05-13 15:06   ` Andy Shevchenko
2018-05-14 13:04     ` William Breathitt Gray [this message]
2018-05-14 17:08       ` Andy Shevchenko
2018-05-08 13:27 ` [PATCH v2 2/7] gpio: 104-dio-48e: Utilize " William Breathitt Gray
2018-05-08 13:27 ` [PATCH v2 3/7] gpio: 104-idi-48: " William Breathitt Gray
2018-05-08 13:27 ` [PATCH v2 4/7] gpio: gpio-mm: " William Breathitt Gray
2018-05-08 13:27 ` [PATCH v2 5/7] gpio: ws16c48: " William Breathitt Gray
2018-05-08 13:28 ` [PATCH v2 6/7] gpio: pci-idio-16: " William Breathitt Gray
2018-05-08 13:28 ` [PATCH v2 7/7] gpio: pcie-idio-24: " William Breathitt Gray
2018-05-13 15:11 ` [PATCH v2 0/7] Introduce the " Andy Shevchenko
2018-05-14 12:57   ` William Breathitt Gray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180514130438.GB20325@sophia \
    --to=vilhelm.gray@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=arnd@arndb.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH v2 1/7] bitops: Introduce the for_each_set_port_word macro' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).