From: Marc Kleine-Budde Date: Wed, 18 Jun 2025 12:00:08 +0000 (+0200) Subject: net: fec: fec_enet_rx_queue(): replace manual VLAN header calculation with skb_vlan_e... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e4a3659a986e06c9e93f4167caa2907443f67063;p=thirdparty%2Flinux.git net: fec: fec_enet_rx_queue(): replace manual VLAN header calculation with skb_vlan_eth_hdr() For better readability and maintainability, use the provided helper function skb_vlan_eth_hdr() to replace manual the VLAN header calculation, and change the type of vlan_header to struct vlan_ethhdr to take into account that the Ethernet header plus VLAN header is returned. Reviewed-by: Frank Li Reviewed-by: Wei Fang Reviewed-by: Andrew Lunn Signed-off-by: Marc Kleine-Budde Link: https://patch.msgid.link/20250618-fec-cleanups-v4-8-c16f9a1af124@pengutronix.de Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 9e4164fc0cd1d..45dd96f4786e9 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1859,8 +1859,7 @@ fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, int budget) fep->bufdesc_ex && (ebdp->cbd_esc & cpu_to_fec32(BD_ENET_RX_VLAN))) { /* Push and remove the vlan tag */ - struct vlan_hdr *vlan_header = - (struct vlan_hdr *) (data + ETH_HLEN); + struct vlan_ethhdr *vlan_header = skb_vlan_eth_hdr(skb); vlan_tag = ntohs(vlan_header->h_vlan_TCI); vlan_packet_rcvd = true;