]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: stmmac: use BIT_U32() and GENMASK_U32() for PCS registers
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Sun, 11 Jan 2026 13:15:09 +0000 (13:15 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 13 Jan 2026 03:36:49 +0000 (19:36 -0800)
commita2745a99ca4ebe6cb7839441685fd8cd82fc4b11
tree4fb5d3e407717d3c805ecf9560d7f9bee654f3c0
parent0391ab577c6e2ed7a0d8cb3e7a1da58497b6ff4f
net: stmmac: use BIT_U32() and GENMASK_U32() for PCS registers

stmmac registers a 32-bit. u32 is unsigned int. The use of BIT() and
GENMASK() leads to integer promotion to unsigned long in expressions
such as:

u32 old = foo;

dev_info(dev, "%08x %08x\n", old, old & BIT(1));

resulting in arg2 being accepted as compatible with the format string
and arg3 warning that the argument does not match (because the former
is unsigned int, and the latter is unsigned long.)

Fix this by defining 32-bit register bits using BIT_U32() and
GENMASK_U32() macros.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vevHh-00000002YoM-1TYL@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.h