From: David Laight <david.laight.linux@gmail.com>
To: David Lechner <dlechner@baylibre.com>
Cc: "Piyush Patle" <piyushpatle228@gmail.com>,
"Jonathan Cameron" <jic23@kernel.org>,
linux-iio@vger.kernel.org, "Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Daniel Lezcano" <daniel.lezcano@kernel.org>,
"Alexandru-Catalin Ionita" <alexandru-catalin.ionita@nxp.com>,
"Felix Gu" <ustc.gu@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: nxp-sar-adc: use field_get() for EOC bit check
Date: Sat, 11 Apr 2026 13:14:51 +0100 [thread overview]
Message-ID: <20260411131451.1e8af16d@pumpkin> (raw)
In-Reply-To: <c885c62c-f0d0-4dae-87d2-e6fb7257cafc@baylibre.com>
On Fri, 10 Apr 2026 16:26:05 -0500
David Lechner <dlechner@baylibre.com> wrote:
> On 4/10/26 4:13 PM, Piyush Patle wrote:
> > The driver uses FIELD_GET() for constant-mask fields but falls back
> > to a raw bit test for the per-channel EOC bit, as the mask depends
> > on the runtime channel index. A TODO notes that this should switch
> > to field_get() when available.
>
> Could drop this first paragraph, it is a bit redundant.
>
> >
> > Use field_get() here now that runtime-mask support exists, and drop
>
> We like for commit messages to start with the verb like this, so
> this would be ideal for the first paragraph of the commit message.
>
> > the obsolete TODO. Since NXP_SAR_ADC_EOC_CH(c) is BIT(c), the
> > resulting !-test is semantically identical.
> >
> > No functional change.
> >
> > Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
> > ---
> Reviewed-by: David Lechner <dlechner@baylibre.com>
>
>
> And if you are interested in doing more like this, search the IIO
> subsystem for __ffs. If it is used with << or >> then there is a
> good chance it could be replaced with field_get() or field_prep().
>
>
And likely make the code larger and slower :-)
At least run the bloat-o-meter.
David
prev parent reply other threads:[~2026-04-11 12:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-10 21:13 [PATCH] iio: adc: nxp-sar-adc: use field_get() for EOC bit check Piyush Patle
2026-04-10 21:26 ` David Lechner
2026-04-10 21:46 ` Piyush Patle
2026-04-11 12:14 ` David Laight [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=20260411131451.1e8af16d@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=alexandru-catalin.ionita@nxp.com \
--cc=andy@kernel.org \
--cc=daniel.lezcano@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=piyushpatle228@gmail.com \
--cc=ustc.gu@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