linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org,
	Clemens Gruber <clemens.gruber@pqgruber.com>,
	Bartosz Golaszewski <brgl@bgdev.pl>
Subject: Re: [PATCH v2] gpio: mmio: Also read bits that are zero
Date: Tue, 16 Jan 2018 12:20:25 +0100	[thread overview]
Message-ID: <20180116112025.GA19826@wunner.de> (raw)
In-Reply-To: <20180116110031.20533-1-linus.walleij@linaro.org>

On Tue, Jan 16, 2018 at 12:00:31PM +0100, Linus Walleij wrote:
> +	bit = -1;
> +	while ((bit = find_next_bit(mask, gc->ngpio, bit + 1)) < gc->ngpio)
>  		readmask |= bgpio_line2mask(gc, bit);

Amend include/linux/bitrev.h with a bitrev64() macro.

Further amend it with a bitrevul() macro which calls bitrev32() or
bitrev(64) depending on the arch's unsigned long size.

Then use bitrevul() on mask and the rest is just OR/AND operations
(instead of the while loop).

Thanks,

Lukas

  reply	other threads:[~2018-01-16 11:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16 11:00 [PATCH v2] gpio: mmio: Also read bits that are zero Linus Walleij
2018-01-16 11:20 ` Lukas Wunner [this message]
2018-01-16 12:09   ` Linus Walleij
2018-01-16 11:52 ` Clemens Gruber

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=20180116112025.GA19826@wunner.de \
    --to=lukas@wunner.de \
    --cc=brgl@bgdev.pl \
    --cc=clemens.gruber@pqgruber.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).