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: <CANZih_QY5ki3nCGDitE-6FAmDi_dgc04WE_QqvOFwJeu912SVQ@mail.gmail.com>
Date: Sat, 14 Jun 2025 16:33:16 -0300
From: Andrew Ijano <andrew.ijano@...il.com>
To: Nuno Sá <noname.nuno@...il.com>
Cc: jic23@...nel.org, andrew.lopes@...mni.usp.br, gustavobastos@....br, 
	dlechner@...libre.com, nuno.sa@...log.com, andy@...nel.org, 
	jstephan@...libre.com, linux-iio@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 2/3] iio: accel: sca3000: replace usages of internal
 read data helpers by spi helpers

On Thu, Jun 12, 2025 at 4:29 AM Nuno Sá <noname.nuno@...il.com> wrote:
>
...
>
> Looks good. Just one comment from me...
>
> >  drivers/iio/accel/sca3000.c | 166 +++++++++++++++---------------------
> >  1 file changed, 68 insertions(+), 98 deletions(-)
> >
> > diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
> > index bfa8a3f5a92f..d41759c68fb4 100644
> > --- a/drivers/iio/accel/sca3000.c
> > +++ b/drivers/iio/accel/sca3000.c
> > @@ -281,24 +281,6 @@ static int sca3000_write_reg(struct sca3000_state *st, u8
> > address, u8 val)
> >       return spi_write(st->us, st->tx, 2);
> >  }
> >
>
> ...
>
> >
> >  static int sca3000_read_data(struct sca3000_state *st,
> >                            u8 reg_address_high,
> > -                          u8 *rx,
> >                            int len)
> >  {
> >       int ret;
> > @@ -974,18 +948,15 @@ static int sca3000_read_data(struct sca3000_state *st,
> >                       .tx_buf = st->tx,
> >               }, {
> >                       .len = len,
> > -                     .rx_buf = rx,
> > +                     .rx_buf = st->rx,
> >               }
> >       };
> > -
> >       st->tx[0] = SCA3000_READ_REG(reg_address_high);
> > +
> >       ret = spi_sync_transfer(st->us, xfer, ARRAY_SIZE(xfer));
> > -     if (ret) {
> > +     if (ret)
> >               dev_err(&st->us->dev, "problem reading register\n");
> > -             return ret;
> > -     }
> > -
> > -     return 0;
> > +     return ret;
>
> Unless I'm missing something, the above seems unrelated to the rest of the patch.
>
Oh, I can see why that might feel unrelated. Actually, this was
related to the first version of the patch which was focused on
removing the duplicated behavior of sca3000_read_data() and
sca3000_read_data_short(), unifying it in only one function. Also,
with Andy's suggestions we cleaned up the function as you're seeing
here. However, we later replaced all usages of
sca3000_read_data_short() by spi helpers, leaving just one place
calling sca3000_read_data(), so this change isn't as necessary as
before.

Do you think it's still a valid cleanup for this patch or would you
prefer moving it to a separated one?

Thanks,
Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ