From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Lorenzo Bianconi" <lorenzo@kernel.org>,
"Francesco Lavra" <flavra@baylibre.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 v2 3/3] iio: imu: st_lsm6dsx: Add support for rotation sensor
Date: Fri, 16 Jan 2026 19:53:17 +0000 [thread overview]
Message-ID: <20260116195317.11c0978a@jic23-huawei> (raw)
In-Reply-To: <aWjyjLnNE-K0AyUi@smile.fi.intel.com>
On Thu, 15 Jan 2026 15:58:36 +0200
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> On Thu, Jan 15, 2026 at 02:51:43PM +0100, Lorenzo Bianconi wrote:
> > On Jan 15, Andy Shevchenko wrote:
> > > On Thu, Jan 15, 2026 at 02:32:11PM +0100, Lorenzo Bianconi wrote:
>
> ...
>
> > > > > + settings = &sensor->hw->settings->sf_settings;
> > > > > + switch (mask) {
> > > > > + case IIO_CHAN_INFO_SAMP_FREQ: {
> > > > > + u32 odr_mHz;
> > > > > + u8 odr_val;
> > > > > +
> > > > > + odr_mHz = val * MILLI + val2 * MILLI / MICRO;
> > > > > + err = st_lsm6dsx_sf_get_odr_val(settings, odr_mHz, &odr_val);
> > > > > + if (err)
> > > > > + return err;
> > > > > +
> > > > > + sensor->hwfifo_odr_mHz = odr_mHz;
> > > > > + return 0;
> > > >
> > > > break;
> > > >
> > > > > + }
> > > > > + default:
> > > > > + return -EINVAL;
> > > >
> > > > break;
> > > >
> > > > > + }
> > > >
> > > > return err;
> > >
> > > Why?
> >
> > I guess it is more clear, but just a Nit, I can live with the current implementation.
>
> At least what you proposed is the opposite to the style that is accepted
> in IIO.
>
My preference is always to minimize flow I need to follow.
If there is a break, I expect to see something to do after the switch
statement and will scroll down to check what it is.
Whilst not the only use, it's one of the reasons cleanup.h stuff is
really handy as it often means there is nothing common to do by
hand before leaving a function.
Jonathan
next prev parent reply other threads:[~2026-01-16 19:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-15 12:24 [PATCH v2 0/3] " Francesco Lavra
2026-01-15 12:24 ` [PATCH v2 1/3] iio: imu: st_lsm6dsx: Set FIFO ODR for accelerometer and gyroscope only Francesco Lavra
2026-01-15 13:13 ` Lorenzo Bianconi
2026-01-16 19:47 ` Jonathan Cameron
2026-01-19 9:06 ` Francesco Lavra
2026-01-15 12:24 ` [PATCH v2 2/3] iio: imu: st_lsm6dsx: Set buffer sampling frequency for accelerometer only Francesco Lavra
2026-01-15 13:18 ` Lorenzo Bianconi
2026-01-16 19:49 ` Jonathan Cameron
2026-01-15 12:24 ` [PATCH v2 3/3] iio: imu: st_lsm6dsx: Add support for rotation sensor Francesco Lavra
2026-01-15 13:32 ` Lorenzo Bianconi
2026-01-15 13:49 ` Andy Shevchenko
2026-01-15 13:51 ` Lorenzo Bianconi
2026-01-15 13:58 ` Andy Shevchenko
2026-01-16 19:53 ` Jonathan Cameron [this message]
2026-01-16 20:04 ` Jonathan Cameron
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=20260116195317.11c0978a@jic23-huawei \
--to=jic23@kernel.org \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=flavra@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo@kernel.org \
--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®