summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2026-01-08 20:36:19 +0300
committerJakub Kicinski <kuba@kernel.org>2026-01-13 05:02:11 +0300
commite91a7e45bf0b013dd63bc3311c25e95b498d27f0 (patch)
tree7ef241b4209d32730d3b44378db2f2e5c6239caf /drivers
parent65b21a7d4de48f5fede3c78495b4fdf61762005e (diff)
downloadlinux-e91a7e45bf0b013dd63bc3311c25e95b498d27f0.tar.xz
net: stmmac: dwmac4: fix PTP message type field extraction
In dwmac4_wrback_get_rx_status(), the code extracts the PTP message type from receive descriptor 1 using the dwmac enhanced descriptor definitions: message_type = (rdes1 & ERDES4_MSG_TYPE_MASK) >> 8; This is defined as: #define ERDES4_MSG_TYPE_MASK GENMASK(11, 8) The correct definition is RDES1_PTP_MSG_TYPE_MASK, which is also defined as: #define RDES1_PTP_MSG_TYPE_MASK GENMASK(11, 8) Use the correct definition, converting to use FIELD_GET() to extract it without needing an open-coded shift right that is dependent on the mask definition. As this change has no effect on the generated code, there is no need to treat this as a bug fix. Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://patch.msgid.link/E1vdtvn-00000002GtV-1wCS@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
index aac68dc28dc1..c84b26d51760 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
@@ -108,7 +108,7 @@ static int dwmac4_wrback_get_rx_status(struct stmmac_extra_stats *x,
ret = discard_frame;
}
- message_type = (rdes1 & ERDES4_MSG_TYPE_MASK) >> 8;
+ message_type = FIELD_GET(RDES1_PTP_MSG_TYPE_MASK, rdes1);
if (rdes1 & RDES1_IP_HDR_ERROR) {
x->ip_hdr_err++;