linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH v1 1/2] gpio: pca953x: Use bitmap API over implicit GCC extension
Date: Thu, 1 Oct 2020 09:26:59 +0200	[thread overview]
Message-ID: <CAMpxmJUrEeuJBf2fwMp8HfNi3sm6c-_g6_dL8OjfM9gQXtunMw@mail.gmail.com> (raw)
In-Reply-To: <20200930142013.59247-1-andriy.shevchenko@linux.intel.com>

On Wed, Sep 30, 2020 at 4:20 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> In IRQ handler we have to clear bitmap before use. Currently
> the GCC extension has been used for that. For sake of the consistency
> switch to bitmap API. As expected bloat-o-meter shows no difference
> in the object size.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/gpio-pca953x.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
> index 0a49ab62cbbd..3f24cfabb1d7 100644
> --- a/drivers/gpio/gpio-pca953x.c
> +++ b/drivers/gpio/gpio-pca953x.c
> @@ -814,10 +814,12 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
>  {
>         struct pca953x_chip *chip = devid;
>         struct gpio_chip *gc = &chip->gpio_chip;
> -       DECLARE_BITMAP(pending, MAX_LINE) = {};
> +       DECLARE_BITMAP(pending, MAX_LINE);
>         int level;
>         bool ret;
>
> +       bitmap_zero(pending, MAX_LINE);
> +
>         mutex_lock(&chip->i2c_lock);
>         ret = pca953x_irq_pending(chip, pending);
>         mutex_unlock(&chip->i2c_lock);
> --
> 2.28.0
>

Makes sense.

Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

  parent reply	other threads:[~2020-10-01  7:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30 14:20 [PATCH v1 1/2] gpio: pca953x: Use bitmap API over implicit GCC extension Andy Shevchenko
2020-09-30 14:20 ` [PATCH v1 2/2] gpio: pca953x: Correctly initialize registers 6 and 7 for PCA957x Andy Shevchenko
2020-10-01  7:27   ` Bartosz Golaszewski
2020-10-01  7:26 ` Bartosz Golaszewski [this message]
2020-10-01  8:02 ` [PATCH v1 1/2] gpio: pca953x: Use bitmap API over implicit GCC extension Linus Walleij

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=CAMpxmJUrEeuJBf2fwMp8HfNi3sm6c-_g6_dL8OjfM9gQXtunMw@mail.gmail.com \
    --to=bgolaszewski@baylibre.com \
    --cc=andriy.shevchenko@linux.intel.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).