From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Matheus Giarola <matheustpgiarola@gmail.com>
Cc: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org,
dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
matheusgiarola@usp.br, arthurpilone@usp.br,
davidbtadokoro@ime.usp.br
Subject: Re: [PATCH v5] iio: adc: ad7280a: replace mutex_lock() with guard(mutex)
Date: Thu, 23 Apr 2026 15:12:10 +0300 [thread overview]
Message-ID: <aeoMmhNTFybLWirf@ashevche-desk.local> (raw)
In-Reply-To: <CABGH8=a77fmjW01gsmBZnKz1bSkQHA4MrVu-_9snpm-Zv3z54g@mail.gmail.com>
On Wed, Apr 22, 2026 at 08:03:43PM -0300, Matheus Giarola wrote:
First of all, do not top-post!
> Thanks for the review. I noticed that there's another student working on the
> same change, so we decided to join efforts and continue on his patch,
> dropping this one.
>
> The other patch can be found at:
> https://lore.kernel.org/linux-iio/20260417131029.12568-1-lucas@ciziks.com/
Make sure that student sees my review that I gave against your contribution.
It will save my time when reviewing that one.
> On Wed, Apr 22, 2026 at 4:46 AM Andy Shevchenko
> <andriy.shevchenko@intel.com> wrote:
> >
> > On Wed, Apr 22, 2026 at 10:44:36AM +0300, Andy Shevchenko wrote:
> > > On Tue, Apr 21, 2026 at 04:08:55PM -0300, Matheus Giarola wrote:
> >
> > ...
> >
> > > > static ssize_t ad7280_show_balance_timer(struct iio_dev *indio_dev,
> > >
> > > > unsigned int msecs;
> > > > int ret;
> > > >
> > > > - mutex_lock(&st->lock);
> > > > - ret = ad7280_read_reg(st, chan->address >> 8,
> > > > + scoped_guard(mutex, &st->lock) {
> > > > + ret = ad7280_read_reg(st, chan->address >> 8,
> > > > (chan->address & 0xFF) + AD7280A_CB1_TIMER_REG);
> > > > - mutex_unlock(&st->lock);
> > > > + }
> > >
> > > Not sure if we need {} here (as it's one statement body), but the indentation
> > > now got broken of the second line there.
> > >
> > > What about
> > >
> > > u8 devaddr = chan->address >> 8;
> > > u8 addr = chan->address;
> >
> > Just checked the second one s/addr/ch/ as per ad7280_store_balance_sw()
> > implementation.
> >
> > > // ...or use existing names in the driver for the same things
> > >
> > > scoped_guard(mutex, &st->lock)
> > > ret = ad7280_read_reg(st, devaddr, addr + AD7280A_CB1_TIMER_REG);
> > >
> > > ?
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-04-23 12:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 19:08 Matheus Giarola
2026-04-22 7:44 ` Andy Shevchenko
2026-04-22 7:46 ` Andy Shevchenko
2026-04-22 23:03 ` Matheus Giarola
2026-04-23 12:12 ` Andy Shevchenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aeoMmhNTFybLWirf@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=arthurpilone@usp.br \
--cc=davidbtadokoro@ime.usp.br \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matheusgiarola@usp.br \
--cc=matheustpgiarola@gmail.com \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®