]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
phy: rockchip-usb: switch to FIELD_PREP_WM16 macro
authorNicolas Frattaroli <nicolas.frattaroli@collabora.com>
Mon, 25 Aug 2025 08:28:32 +0000 (10:28 +0200)
committerYury Norov <yury.norov@gmail.com>
Wed, 3 Sep 2025 00:06:47 +0000 (20:06 -0400)
commita104de64bfbc616042322c699fe96d05a431caab
treeeaba9966cd16d445bdc2745462adfefbcbdfe5ef
parent6fd524c3f85902797067cd41ffd45e91e8e997b7
phy: rockchip-usb: 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.

Remove this driver's HIWORD_UPDATE macro, and replace all instances of
it with (hopefully) equivalent FIELD_PREP_WM16 instances. To do this, a
few of the defines are being adjusted, as FIELD_PREP_WM16 shifts up the
value for us. This gets rid of the icky update(mask, mask) shenanigans.

The benefit of using FIELD_PREP_WM16 is that it does more checking of
the input, hopefully catching errors. In practice, a shared definition
makes code more readable than several different flavours of the same
macro, and the shifted value helps as well.

I do not have the hardware that uses this particular driver, so it's
compile-tested only as far as my own testing goes.

Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
drivers/phy/rockchip/phy-rockchip-usb.c