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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHcu+VaDBj87stJ9JJkuerJkr8=-g68FhUUnKvfpN8uYaMBUhQ@mail.gmail.com>
Date:   Tue, 28 Jul 2020 14:07:00 -0600
From:   Daniel Campello <campello@...omium.org>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     LKML <devicetree@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Jonathan Cameron <jic23@...nel.org>,
        Douglas Anderson <dianders@...omium.org>,
        Gwendal Grignou <gwendal@...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 03/15] iio: sx9310: Fix irq handling

On Tue, Jul 28, 2020 at 12:08 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
>
> On Tue, Jul 28, 2020 at 6:14 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.
>
> > -       enable_irq(data->client->irq);
> > +       if (!ret)
> > +               enable_irq(data->client->irq);
> >
> >         return ret;
> >  }
>
> Can it be a usual pattern?
>
>   if (ret)
>     return ret;
>   ...
>   return 0;

I think this way is more readable. The alternative would have to be
something like this:

....
if (ret)
  goto out;
mutex_unlock(&data->mutex);
enable_irq(data->client->irq);
return 0;

out:
mutex_unlock(&data->mutex);
return ret;

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

Regards,
Daniel Campello

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ