net: fec: fec_enet_rx_queue(): reduce scope of data

In order to clean up of the VLAN handling, reduce the scope of data.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Link: https://patch.msgid.link/20250618-fec-cleanups-v4-9-c16f9a1af124@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Marc Kleine-Budde 2025-06-18 14:00:09 +02:00 committed by Jakub Kicinski
parent e4a3659a98
commit 33b9f31893

View File

@ -1720,7 +1720,6 @@ fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, int budget)
unsigned short status;
struct sk_buff *skb;
ushort pkt_len;
__u8 *data;
int pkt_received = 0;
struct bufdesc_ex *ebdp = NULL;
bool vlan_packet_rcvd = false;
@ -1843,10 +1842,11 @@ fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, int budget)
skb_mark_for_recycle(skb);
if (unlikely(need_swap)) {
u8 *data;
data = page_address(page) + FEC_ENET_XDP_HEADROOM;
swap_buffer(data, pkt_len);
}
data = skb->data;
/* Extract the enhanced buffer descriptor */
ebdp = NULL;
@ -1864,7 +1864,7 @@ fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, int budget)
vlan_packet_rcvd = true;
memmove(skb->data + VLAN_HLEN, data, ETH_ALEN * 2);
memmove(skb->data + VLAN_HLEN, skb->data, ETH_ALEN * 2);
skb_pull(skb, VLAN_HLEN);
}