lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 31 Jul 2020 21:35:12 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Daniel Campello <campello@...omium.org>
Cc:     LKML <devicetree@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Jonathan Cameron <jic23@...nel.org>,
        Douglas Anderson <dianders@...omium.org>,
        Hartmut Knaack <knaack.h@....de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald-Stadler <pmeerw@...erw.net>,
        Stephen Boyd <swboyd@...omium.org>,
        linux-iio <linux-iio@...r.kernel.org>
Subject: Re: [PATCH v3 03/15] iio: sx9310: Fix irq handling

On Fri, Jul 31, 2020 at 7:49 PM Daniel Campello <campello@...omium.org> wrote:
>
> Fixes enable/disable irq handling at various points. The driver needs to
> only enable/disable irqs if there is an actual irq handler installed.

...

>  static int sx9310_enable_irq(struct sx9310_data *data, unsigned int irq)
>  {
> -       return regmap_update_bits(data->regmap, SX9310_REG_IRQ_MSK, irq, irq);
> +       if (data->client->irq)
> +               return regmap_update_bits(data->regmap, SX9310_REG_IRQ_MSK, irq,
> +                                         irq);
> +       return 0;

Wouldn't it be better to insert rather
if (!irq)
  return 0;
than disrupting the entire function?

>  }
>
>  static int sx9310_disable_irq(struct sx9310_data *data, unsigned int irq)
>  {
> -       return regmap_update_bits(data->regmap, SX9310_REG_IRQ_MSK, irq, 0);
> +       if (data->client->irq)
> +               return regmap_update_bits(data->regmap, SX9310_REG_IRQ_MSK, irq,
> +                                         0);
> +       return 0;

Ditto.

>  }



-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ