[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANZih_Q5WJD9TSnyhPHcygFJDEvvkj1KdWO-1=QO-1Uhr6tLCA@mail.gmail.com>
Date: Sun, 11 May 2025 14:23:24 -0300
From: Andrew Ijano <andrew.ijano@...il.com>
To: Andy Shevchenko <andy.shevchenko@...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 v3] iio: accel: sca3000: replace usages of internal read
data helpers by spi helpers
Going back to this one to reply to the unaddressed comments.
On Fri, May 9, 2025 at 6:06 AM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
>
...
>
> > chan->scan_type.shift,
>
> With the above done, move this parameter to the previous line.
Ok! I reorganized this shift operation to be all in one line.
...
>
> > - *val = (be16_to_cpup((__be16 *)st->rx) >>
> > + *val = (be16_to_cpu((__be16) ret) >>
> > chan->scan_type.shift) &
> > GENMASK(chan->scan_type.realbits - 1, 0);
>
> Ditto.
Thanks, I changed here too.
...
> > - else if (!state && (st->rx[0] & SCA3000_REG_MODE_FREE_FALL_DETECT))
> > + else if (!state && (ret & SCA3000_REG_MODE_FREE_FALL_DETECT))
>
> Remove redundant 'else'
>
> > return sca3000_write_reg(st, SCA3000_REG_MODE_ADDR,
> > - st->rx[0] & ~SCA3000_REG_MODE_FREE_FALL_DETECT);
> > + ret & ~SCA3000_REG_MODE_FREE_FALL_DETECT);
> > else
>
> Ditto.
Ok! Removed both of them.
...
>
> > ret = sca3000_write_reg(st, SCA3000_REG_MODE_ADDR,
> > - (st->rx[0] & SCA3000_MODE_PROT_MASK));
> > + (ret & SCA3000_MODE_PROT_MASK));
>
> Remove unneeded parentheses.
...
>
> > ret = sca3000_write_reg(st, SCA3000_REG_INT_MASK_ADDR,
>
> > - (st->rx[0] &
> > + (ret &
> > ~(SCA3000_REG_INT_MASK_RING_THREE_QUARTER |
> > SCA3000_REG_INT_MASK_RING_HALF |
> > SCA3000_REG_INT_MASK_ALL_INTS)));
>
> Remove unneeded parentheses (outer for the last parameter).
Great! Removed all the unneeded parentheses then.
--
Thanks again for these comments,
Andrew
Powered by blists - more mailing lists