[PATCH V3 2/9] iio: imu: inv_icm42607: Add Core for inv_icm42607 Driver
Jonathan Cameron
jic23 at kernel.org
Tue Apr 14 11:29:14 PDT 2026
On Tue, 14 Apr 2026 10:14:48 +0300
Andy Shevchenko <andriy.shevchenko at intel.com> wrote:
> On Mon, Apr 13, 2026 at 08:06:54PM +0100, Jonathan Cameron wrote:
> > On Mon, 30 Mar 2026 14:58:46 -0500
> > Chris Morgan <macroalpha82 at gmail.com> wrote:
>
> ...
>
> > > + if (!conf->temp_en)
> > > + val |= INV_ICM42607_PWR_MGMT0_ACCEL_LP_CLK_SEL;
> >
> > Could make this
> > val |= FIELD_PREP(INV_ICM42607_PWR_MGMT0_ACCEL_LP_CLK_SEL,
> > !conf->temp_en);
> > Not particularly important though if you prefer the if.
>
> Isn't this becomes FIELD_MODIFY()?
>
Yes, in this particular case as the bit has never been set before
this line, they end up the same. If the compiler fails to notice it
doesn't need to zero the bit if conf->temp_en is true might make it more
efficient to do it the way I had it but given this isn't a fast
path, FIELD_MODIFY() is fine.
Jonathan
More information about the Linux-rockchip
mailing list