From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "Maxwell Doose" <m32285159@gmail.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: humidity: ens210: remove compiler warning workaround
Date: Tue, 2 Jun 2026 21:06:03 +0300 [thread overview]
Message-ID: <ah8bi2hsftoGQG4i@ashevche-desk.local> (raw)
In-Reply-To: <20260522133717.32772423@jic23-huawei>
On Fri, May 22, 2026 at 01:37:17PM +0100, Jonathan Cameron wrote:
> On Fri, 22 May 2026 00:25:08 -0500
> Maxwell Doose <m32285159@gmail.com> wrote:
> > On Thu, May 21, 2026 at 8:26 PM David Lechner <dlechner@baylibre.com> wrote:
...
> > > - case IIO_CHAN_INFO_RAW:
> > > - scoped_guard(mutex, &data->lock) {
> > > - ret = ens210_get_measurement(
> > > - indio_dev, channel->type == IIO_TEMP, val);
> > > - if (ret)
> > > - return ret;
> > > - return IIO_VAL_INT;
> > > - }
> > > - return -EINVAL; /* compiler warning workaround */
We may just drop this return statement, but in this case some people may be
confused. In addition the patch fixes the indentation of the function
parameters, which is good on itself.
> > > + case IIO_CHAN_INFO_RAW: {
> > > + guard(mutex)(&data->lock);
> > > +
> > > + ret = ens210_get_measurement(indio_dev, channel->type == IIO_TEMP,
> > > + val);
> > > + if (ret)
> > > + return ret;
> > > +
> > > + return IIO_VAL_INT;
> > > + }
> > I'm questioning how that initial commit got merged at all, they
> > could've just used guard()() with {} (the kind of thing to make me
> > want to take a look at this file even further!). Visually looks good
> > to me but will follow-up later with rb if it all checks out.
>
> The guard stuff was fairly new at the time so we were still working out what
> patterns make sense. Took a little while for consensus to emerge!
>
> Anyhow patch is obviously correct and a cleanup so applied to the testing
> branch of iio.git. Happy to add tags etc for next few days
> (or drop it if I'm missing something!)
Taking the above into consideration,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-06-02 18:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 1:25 David Lechner
2026-05-22 5:25 ` Maxwell Doose
2026-05-22 12:37 ` Jonathan Cameron
2026-05-22 12:43 ` Maxwell Doose
2026-06-02 18:06 ` 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=ah8bi2hsftoGQG4i@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m32285159@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®