From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Hungyu Lin <dennylin0707@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"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] iio: magnetometer: bmc150: use FIELD_PREP and FIELD_GET helpers
Date: Tue, 9 Jun 2026 17:29:27 +0300 [thread overview]
Message-ID: <aigjR-Pf8Vy3sjxy@ashevche-desk.local> (raw)
In-Reply-To: <20260609012145.87180-1-dennylin0707@gmail.com>
On Tue, Jun 09, 2026 at 01:21:45AM +0000, Hungyu Lin wrote:
> Replace open-coded bitfield operations with FIELD_PREP() and
> FIELD_GET() helpers where appropriate.
>
> Also simplify bmc150_magn_set_odr() by returning directly from
> the matching table entry.
...
> ret = regmap_read(data->regmap, BMC150_MAGN_REG_OPMODE_ODR, ®_val);
> if (ret < 0)
> return ret;
> - odr_val = (reg_val & BMC150_MAGN_MASK_ODR) >> BMC150_MAGN_SHIFT_ODR;
> +
Stray addition. This calculation is coupled with the above regmap, so I see
a value of having no blank line there (as in the original code).
> + odr_val = FIELD_GET(BMC150_MAGN_MASK_ODR, reg_val);
>
> for (i = 0; i < ARRAY_SIZE(bmc150_magn_samp_freq_table); i++)
...
The rest looks good to me, I dunno if Jonathan wants a new version (probably
he does as IIO closed for this cycle anyway).
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-06-09 14:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 1:21 Hungyu Lin
2026-06-09 14:29 ` 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=aigjR-Pf8Vy3sjxy@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dennylin0707@gmail.com \
--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 \
/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®