From: Jonathan Cameron <jic23@kernel.org>
To: Joshua Crofts <joshua.crofts1@gmail.com>
Cc: "Salah Triki" <salah.triki@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: accel: sca3000: fix frequency divider condition check
Date: Sun, 23 Aug 2026 01:48:41 +0100 [thread overview]
Message-ID: <20260823014841.0ec4be19@jic23-huawei> (raw)
In-Reply-To: <20260819135156.00002b2c@gmail.com>
On Wed, 19 Aug 2026 13:51:56 +0200
Joshua Crofts <joshua.crofts1@gmail.com> wrote:
> On Wed, 19 Aug 2026 12:41:01 +0100
> Salah Triki <salah.triki@gmail.com> wrote:
>
> > When setting the sampling frequency, the check for `base_freq / 2` is
> > followed by an independent `if` statement for `base_freq / 4`. If `val`
> > equals `base_freq / 2`, the second check fails and falls through to the
> > `else if (val != base_freq)` branch, returning `-EINVAL` erroneously.
> >
> > Fix this by chaining the checks with `else if`.
> >
> > Signed-off-by: Salah Triki <salah.triki@gmail.com>
> > ---
>
> Good catch, this issue is 10 years old!
>
> However, you're missing a fixes tag, I think b4 will pick it up
> if I leave it here since I already ran git blame.
>
> Fixes: e0f3fc9b47e6 ("iio: accel: sca3000_core: implemented IIO_CHAN_INFO_SAMP_FREQ")
Thanks - b4 indeed picks it up. It saves me time even though b4 puts it
in the wrong place (well the right place given it came from the thread, but
wrong as it should have been there in the first place).
>
> + cc stable
>
> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Applied to the fixes-togreg branch of iio.git and marked for stable.
Thanks,
Jonathan
>
next prev parent reply other threads:[~2026-08-23 0:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 11:41 [PATCH] iio: accel: sca3000: fix frequency divider condition check Salah Triki
2026-08-19 11:51 ` Joshua Crofts
2026-08-23 0:48 ` Jonathan Cameron [this message]
2026-08-19 13:38 ` Andy Shevchenko
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=20260823014841.0ec4be19@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=joshua.crofts1@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=salah.triki@gmail.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;
as well as URLs for NNTP newsgroup(s).