From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Guilherme Dias <guilhermeabreu200105@usp.br>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
nish.malpani25@gmail.com, lars@metafoo.de,
Michael.Hennerich@analog.com, dlechner@baylibre.com,
nuno.sa@analog.com, andy@kernel.org,
"João Paulo Menezes Linaris" <jplinaris@usp.br>,
linux-iio@vger.kernel.org
Subject: Re: [PATCH v2] iio: gyro: adxrs290: Use guard(mutex) in lieu of manual lock+unlock
Date: Tue, 28 Apr 2026 11:01:28 +0300 [thread overview]
Message-ID: <afBpWD4YXew6cVrx@ashevche-desk.local> (raw)
In-Reply-To: <CAH1eeHs5M4rDhdtmyWadFFsx3qK9=xST67h1zwb0-CwDV=aLrQ@mail.gmail.com>
On Mon, Apr 27, 2026 at 07:04:23PM -0300, Guilherme Dias wrote:
> Em sex., 24 de abr. de 2026 às 07:39, Jonathan Cameron
> <jic23@kernel.org> escreveu:
> > On Fri, 24 Apr 2026 12:24:07 +0300
> > Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> > > On Thu, Apr 23, 2026 at 07:37:51PM -0300, Guilherme Dias wrote:
...
> > > > /* exercise a bulk data capture starting from reg DATAX0... */
> > > > ret = spi_write_then_read(st->spi, &tx, sizeof(tx), st->buffer.channels,
> > > > sizeof(st->buffer.channels));
> > > > - if (ret < 0)
> > > > - goto out_unlock_notify;
> > > > + if (ret >= 0)
> > No to this as well. Keep the error out of line. Which makes the use
> > of guard() here tricky. You could do a do { guard(); } while(0) loop so that
> > you can use break with out it being odd looking.
> >
> > (I don't like breaks out of scoped_guard() because it's non obvious scoped
> > guard is actually a loop.
>
> Thanks for the suggestion — just to confirm I understood correctly, do
> you mean something like this?
Yes, with proper indentation made.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-04-28 8:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260423223958.100487-1-guilhermeabreu200105@usp.br>
[not found] ` <aes2tzgfXbuD6ccQ@ashevche-desk.local>
[not found] ` <20260424113901.0508dbc2@jic23-huawei>
2026-04-27 22:04 ` [PATCH v2] iio: gyro: adxrs290: Use guard(mutex) in lieu of manual lock+unlock Guilherme Dias
2026-04-28 8:01 ` 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=afBpWD4YXew6cVrx@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=guilhermeabreu200105@usp.br \
--cc=jic23@kernel.org \
--cc=jplinaris@usp.br \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=nish.malpani25@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