Re: [PATCH 07/12] iio: pressure: rohm-bm1390: Fix AVE_NUM initialization
From: Jonathan Cameron
Date: Sun Aug 23 2026 - 18:38:26 EST
On Mon, 17 Aug 2026 08:43:26 +0300
Matti Vaittinen <mazziesaccount@xxxxxxxxx> wrote:
> On 17/08/2026 04:19, Jonathan Cameron wrote:
> > On Tue, 11 Aug 2026 13:08:14 +0300
> > Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
> >
> >> On Tue, Aug 11, 2026 at 12:05:47PM +0300, Matti Vaittinen wrote:
> >>> On 10/08/2026 23:06, Andy Shevchenko wrote:
> >>>> On Mon, Aug 10, 2026 at 10:53:07AM +0300, Matti Vaittinen wrote:
> >>
> >> ...
> >>
> >>>>> Use FIELD_PREP() to shift the intended AVE_NUM value to correct field.
> >>>>
> >>>> Can it be FIELD_PREP_CONST()?
> >>>
> >>> Can you please elaborate why it should in this case?
> >>
> >> I'm not sure why it's not obvious, but the parameters are constants, why would
> >> we need an additional check or even checks?
> >>
> > I'm not sure it is as obvious as the name would suggest.
> > FIELD_PREP() has a whole bunch of stuff that runs if it happens
> > to have a build time constant value + FIELD_PREP_CONST() is
> > documented as primarily being there when the code requires a constant
> > to be correct.
>
> This is what I read. My first thought was that FIELD_PREP_CONST() is
> useful when constant initializer is needed. So no, not obvious for me.
>
Applied. It's in the testing branch, so I can rebase if this discussion
restarts, but it seems to have died out.
Jonathan
> Yours,
> -- Matti
>