[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aK5aujavDc4PvvjO@yury>
Date: Tue, 26 Aug 2025 21:09:26 -0400
From: Yury Norov <yury.norov@...il.com>
To: Nicolas Frattaroli <nicolas.frattaroli@...labora.com>
Cc: Rasmus Villemoes <linux@...musvillemoes.dk>,
Jaehoon Chung <jh80.chung@...sung.com>,
Ulf Hansson <ulf.hansson@...aro.org>,
Heiko Stuebner <heiko@...ech.de>,
Shreeya Patel <shreeya.patel@...labora.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Sandy Huang <hjc@...k-chips.com>,
Andy Yan <andy.yan@...k-chips.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Vinod Koul <vkoul@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Nicolas Frattaroli <frattaroli.nicolas@...il.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>, Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Shawn Lin <shawn.lin@...k-chips.com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof WilczyĆski <kwilczynski@...nel.org>,
Manivannan Sadhasivam <mani@...nel.org>,
Rob Herring <robh@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
Chanwoo Choi <cw00.choi@...sung.com>,
MyungJoo Ham <myungjoo.ham@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>,
Qin Jian <qinjian@...lus1.com>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>, kernel@...labora.com,
linux-kernel@...r.kernel.org, linux-mmc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-media@...r.kernel.org,
dri-devel@...ts.freedesktop.org, linux-phy@...ts.infradead.org,
linux-sound@...r.kernel.org, netdev@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com, linux-pci@...r.kernel.org,
linux-pm@...r.kernel.org, linux-clk@...r.kernel.org,
llvm@...ts.linux.dev,
Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
Subject: Re: [PATCH v3 00/20] BYEWORD_UPDATE: unifying (most) HIWORD_UPDATE
macros
Hi Nicolas,
Thanks for the work!
On Mon, Aug 25, 2025 at 10:28:20AM +0200, Nicolas Frattaroli wrote:
> This series was spawned by [1], where I was asked to move every instance
> of HIWORD_UPDATE et al that I could find to a common macro in the same
> series that I am introducing said common macro.
>
> The first patch of the series introduces a new header file,
> hw_bitfield.h, which contains two new macros: FIELD_PREP_WM16 and
> FIELD_PREP_WM16_CONST. The latter can be used in initializers.
>
> I've cheekily added the hw_bitfield.h header to the BITMAP API section
> of the MAINTAINERS file.
>
> This macro definition checks that the mask fits, and that the value fits
> in the mask. Like FIELD_PREP, it also shifts the value up to the mask,
> so turning off a bit does not require using the mask as a value. Masks
> are also required to be contiguous, like with FIELD_PREP.
>
> For each definition of such a macro, the driver(s) that used it were
> evaluated for three different treatments:
> - full conversion to the new macro, for cases where replacing the
> implementation of the old macro wouldn't have worked, or where the
> conversion was trivial. These are the most complex patches in this
> series, as they sometimes have to pull apart definitions of masks
> and values due to the new semantics, which require a contiguous
> mask and shift the value for us.
> - replacing the implementation of the old macro with an instance of the
> new macro, done where I felt it made the patch much easier to review
> because I didn't want to drop a big diff on people.
> - skipping conversion entirely, usually because the mask is
> non-constant and it's not trivial to make it constant. Sometimes an
> added complication is that said non-constant mask is either used in a
> path where runtime overhead may not be desirable, or in an
> initializer.
>
> Left out of conversion:
> - drivers/mmc/host/sdhci-of-arasan.c: mask is non-constant.
+ Michal Simek <michal.simek@....com>
> - drivers/phy/rockchip/phy-rockchip-inno-csidphy.c: mask is
> non-constant likely by way of runtime pointer dereferencing, even if
> struct and members are made const.
+ Vinod Koul <vkoul@...nel.org> (already in the list)
> - drivers/clk/rockchip/clk.h: way too many clock drivers use non-const
> masks in the context of an initializer.
+ Heiko Stuebner <heiko@...ech.de> (already in the list)
Guys, can you please take a look? Would be nice to finish the
consolidation.
--
I'll take #1 and the acknowledged (or at least reviewed) per-driver
fixes in bitmap-for-next in 2-3 weeks before the end of cycle.
Everyone, please send your tags!
Nicolas, please ping me if I forget. For the rest of the series, in
case of no feedback from maintainers, let's wait for one more merge
window, and then move everything altogether.
Thanks,
Yury
Powered by blists - more mailing lists