[PATCH net-next 3/9] net: stmmac: dwmac4: fix PTP message type field extraction

Maxime Chevallier maxime.chevallier at bootlin.com
Wed Jan 7 00:41:56 PST 2026



On 06/01/2026 21:31, Russell King (Oracle) wrote:
> 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.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>

Reviewed-by: Maxime Chevallier <maxime.chevallier at bootlin.com>

Maxime



More information about the linux-arm-kernel mailing list