]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: stmmac: dwmac-rk: switch to FIELD_PREP_WM16 macro
authorNicolas Frattaroli <nicolas.frattaroli@collabora.com>
Mon, 25 Aug 2025 08:28:35 +0000 (10:28 +0200)
committerYury Norov <yury.norov@gmail.com>
Wed, 3 Sep 2025 00:06:47 +0000 (20:06 -0400)
commita785472bb0c2af5bd713c9f2d7cf45657cb3e7bf
tree791d6983f87838ccd8bc8acde7ca418a4f33ba9d
parent3d1ef6e4a154460cb75aacc4d3b77f7212b3c542
net: stmmac: dwmac-rk: switch to FIELD_PREP_WM16 macro

The era of hand-rolled HIWORD_UPDATE macros is over, at least for those
drivers that use constant masks.

Like many other Rockchip drivers, dwmac-rk has its own HIWORD_UPDATE
macro. Its semantics allow us to redefine it as a wrapper to the shared
hw_bitfield.h FIELD_PREP_WM16 macros though.

Replace the implementation of this driver's very own HIWORD_UPDATE macro
with an instance of FIELD_PREP_WM16 from hw_bitfield.h. This keeps the
diff easily reviewable, while giving us more compile-time error
checking.

The related GRF_BIT macro is left alone for now; any attempt to rework
the code to not use its own solution here would likely end up harder to
review and less pretty for the time being.

Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c