diff mbox series

[v1,1/2] gpio: pca953x: Use bitmap API over implicit GCC extension

Message ID 20200930142013.59247-1-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v1,1/2] gpio: pca953x: Use bitmap API over implicit GCC extension | expand

Commit Message

Andy Shevchenko Sept. 30, 2020, 2:20 p.m. UTC
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(-)

Comments

Bartosz Golaszewski Oct. 1, 2020, 7:26 a.m. UTC | #1
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>
Linus Walleij Oct. 1, 2020, 8:02 a.m. UTC | #2
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>

Both patches applied!

Yours,
Linus Walleij
diff mbox series

Patch

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);