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]
Message-ID: <CAHp75Vc=c=0yhtaKuiE4mZTTzQdrPywt89E7A1GuHha9=V=GUQ@mail.gmail.com>
Date: Mon, 17 Mar 2025 17:51:54 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Jonathan Cameron <jic23@...nel.org>
Cc: Lothar Rubusch <l.rubusch@...il.com>, lars@...afoo.de, Michael.Hennerich@...log.com, 
	linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org, eraretuya@...il.com
Subject: Re: [PATCH v4 04/14] iio: accel: adxl345: introduce
 adxl345_push_event function

On Mon, Mar 17, 2025 at 12:56 PM Jonathan Cameron <jic23@...nel.org> wrote:
> On Sun, 16 Mar 2025 21:58:00 +0200
> Andy Shevchenko <andy.shevchenko@...il.com> wrote:
> > Thu, Mar 13, 2025 at 04:50:39PM +0000, Lothar Rubusch kirjoitti:

...

> > > +static int adxl345_push_event(struct iio_dev *indio_dev, int int_stat)
> > > +{
> > > +   struct adxl345_state *st = iio_priv(indio_dev);
> > > +   int samples;

> > > +   int ret = -ENOENT;

Also note, this variable is redundant as far as I can see, just return
the error code directly.

> > > +
> > > +   if (FIELD_GET(ADXL345_INT_WATERMARK, int_stat)) {
> > > +           samples = adxl345_get_samples(st);
> > > +           if (samples < 0)
> >
> > > +                   return -EINVAL;
> >
> > In the original code it makes no difference, but if you are going to share
> > this, I would expect to see
> >
> >                       return samples;
> >
> > here. Why the error code is shadowed? If it's trully needed, it has to be
> > explained in the comment.
> >
> >
> > > +           if (adxl345_fifo_push(indio_dev, samples) < 0)
> > > +                   return -EINVAL;
> > > +   }
> > > +
> > > +   return ret;
> > > +}

...

> > Jonathan, I saw that you had applied it, but I guess the above needs
> > a clarification.
> Was right at the top of a tree I don't mind rebasing. So dropped
> this patch (kept 1-3)

Thank you!

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ