Skip to content

Commit 4c89a8e

Browse files
marckleinebuddeNipaLocal
authored andcommitted
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 <[email protected]> Reviewed-by: Wei Fang <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent dc97c68 commit 4c89a8e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,8 +1859,7 @@ fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, int budget)
18591859
fep->bufdesc_ex &&
18601860
(ebdp->cbd_esc & cpu_to_fec32(BD_ENET_RX_VLAN))) {
18611861
/* Push and remove the vlan tag */
1862-
struct vlan_hdr *vlan_header =
1863-
(struct vlan_hdr *) (data + ETH_HLEN);
1862+
struct vlan_ethhdr *vlan_header = skb_vlan_eth_hdr(skb);
18641863
vlan_tag = ntohs(vlan_header->h_vlan_TCI);
18651864

18661865
vlan_packet_rcvd = true;

0 commit comments

Comments
 (0)