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:   Sat, 3 Sep 2022 16:58:25 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Crt Mori <cmo@...exis.com>
Cc:     Jonathan Cameron <jic23@...nel.org>,
        linux-iio <linux-iio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/3] iio: temperature: mlx90632 Add runtime
 powermanagement modes

On Sat, Sep 3, 2022 at 3:06 PM Crt Mori <cmo@...exis.com> wrote:
> On Fri, 2 Sept 2022 at 20:39, Andy Shevchenko <andy.shevchenko@...il.com> wrote:
> > On Fri, Sep 2, 2022 at 8:59 PM Crt Mori <cmo@...exis.com> wrote:
> > > On Fri, 2 Sept 2022 at 17:28, Andy Shevchenko <andy.shevchenko@...il.com> wrote:
> > > > On Fri, Sep 2, 2022 at 4:13 PM <cmo@...exis.com> wrote:

...


> > > > > +       if (current_powerstatus == MLX90632_PWR_STATUS_SLEEP_STEP)
> > > > > +               return mlx90632_pwr_set_sleep_step(data->regmap);
> > > >
> > > > > +       else
> > > >
> > > > Redundant.
> > > >
> > > No, the powermode changes among the type.
> >
> > Yes. 'else' keyword is always redundant in the
> >
> >   if (...)
> >     return / break / continue / goto
> >   else

> > cases.
> >
> In this case current power mode of the sensor is halt, so the else is
> needed to set it to continuous mode, which means I can't just remove
> the else here because this statement restores the power mode before
> this function was entered (and changed powermode for the setup).

What do you mean by all this? Read your code again and see what I'm
talking about...

> > > > > +               return mlx90632_pwr_continuous(data->regmap);

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ