[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251109125956.106c9a1a@jic23-huawei>
Date: Sun, 9 Nov 2025 12:59:56 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Michael Turquette <mturquette@...libre.com>, Stephen Boyd
<sboyd@...nel.org>, Nicolas Ferre <nicolas.ferre@...rochip.com>, Alexandre
Belloni <alexandre.belloni@...tlin.com>, Claudiu Beznea
<claudiu.beznea@...on.dev>, Giovanni Cabiddu <giovanni.cabiddu@...el.com>,
Herbert Xu <herbert@...dor.apana.org.au>, David Miller
<davem@...emloft.net>, Linus Walleij <linus.walleij@...aro.org>, Bartosz
Golaszewski <brgl@...ev.pl>, Joel Stanley <joel@....id.au>, Andrew Jeffery
<andrew@...econstruct.com.au>, Crt Mori <cmo@...exis.com>, Lars-Peter
Clausen <lars@...afoo.de>, Jacky Huang <ychuang3@...oton.com>, Shan-Chun
Hung <schung@...oton.com>, Yury Norov <yury.norov@...il.com>, Rasmus
Villemoes <linux@...musvillemoes.dk>, Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, Johannes Berg <johannes@...solutions.net>,
Jakub Kicinski <kuba@...nel.org>, Alex Elder <elder@...e.org>, David Laight
<david.laight.linux@...il.com>, Vincent Mailhol
<mailhol.vincent@...adoo.fr>, Jason Baron <jbaron@...mai.com>, Borislav
Petkov <bp@...en8.de>, Tony Luck <tony.luck@...el.com>, Michael Hennerich
<Michael.Hennerich@...log.com>, Kim Seer Paller
<kimseer.paller@...log.com>, David Lechner <dlechner@...libre.com>, Nuno
Sá <nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>,
Richard Genoud <richard.genoud@...tlin.com>, Cosmin Tanislav
<demonsingur@...il.com>, Biju Das <biju.das.jz@...renesas.com>, Jianping
Shen <Jianping.Shen@...bosch.com>, linux-clk@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-renesas-soc@...r.kernel.org,
linux-crypto@...r.kernel.org, linux-edac@...r.kernel.org,
qat-linux@...el.com, linux-gpio@...r.kernel.org,
linux-aspeed@...ts.ozlabs.org, linux-iio@...r.kernel.org,
linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next v5 10/23] iio: imu: smi330: #undef
field_{get,prep}() before definition
On Mon, 3 Nov 2025 11:09:36 +0100
Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
> Hi Jonathan,
>
> On Sun, 2 Nov 2025 at 11:43, Jonathan Cameron <jic23@...nel.org> wrote:
> > On Mon, 27 Oct 2025 19:41:44 +0100
> > Geert Uytterhoeven <geert+renesas@...der.be> wrote:
> >
> > > Prepare for the advent of globally available common field_get() and
> > > field_prep() macros by undefining the symbols before defining local
> > > variants. This prevents redefinition warnings from the C preprocessor
> > > when introducing the common macros later.
> > >
> > > Suggested-by: Yury Norov <yury.norov@...il.com>
> > > Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
> >
> > So this is going to make a mess of merging your series given this is
> > queued up for next merge window.
> >
> > I can pick this one up perhaps and we loop back to the replacement of
> > these in a future patch? Or perhaps go instead with a rename
> > of these two which is probably nicer in the intermediate state than
> > undefs.
>
> Renaming would mean a lot of churn.
> Just picking up the #undef patch should be simple and safe? The
> removal of the underf and redef can be done in the next cycle.
> Thanks!
Only 1 call of each of these in the driver, so churn is small either way.
To avoid a bisection problem if your tree merges first I need to modify
this stuff in the original patch or leave it for Linus to deal with as
a merge conflict resolution which is mess I'd rather do without.
So I'll rebase now and rename these functions to have an smi330_ prefix.
Better to potentially cause people problems when I have 23 patches
on top of this (and hopefully no one is based on those yet) than when
I have many more.
So tweaked and pushed out a new version where this patch isn't needed.
We can move to your new code next cycle.
Jonathan
>
> > > --- a/drivers/iio/imu/smi330/smi330_core.c
> > > +++ b/drivers/iio/imu/smi330/smi330_core.c
> > > @@ -68,7 +68,9 @@
> > > #define SMI330_SOFT_RESET_DELAY 2000
> > >
> > > /* Non-constant mask variant of FIELD_GET() and FIELD_PREP() */
> > > +#undef field_get
> > > #define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1))
> > > +#undef field_prep
> > > #define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask))
> > >
> > > #define SMI330_ACCEL_CHANNEL(_axis) { \
>
> Gr{oetje,eeting}s,
>
> Geert
>
Powered by blists - more mailing lists