[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241016-fec-cleanups-v1-11-de783bd15e6a@pengutronix.de>
Date: Wed, 16 Oct 2024 23:51:59 +0200
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Wei Fang <wei.fang@....com>, Shenwei Wang <shenwei.wang@....com>,
Clark Wang <xiaoning.wang@....com>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Richard Cochran <richardcochran@...il.com>
Cc: imx@...ts.linux.dev, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel@...gutronix.de,
Marc Kleine-Budde <mkl@...gutronix.de>
Subject: [PATCH net-next 11/13] net: fec: fec_enet_rx_queue(): reduce scope
of data
In order to clean up of the VLAN handling, reduce the scope of data.
Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
---
drivers/net/ethernet/freescale/fec_main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index fd7a78ec5fa8ac0f7d141779938a4690594dbef1..640fbde10861005e7e2eb23358bfeaac49ec1792 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1686,7 +1686,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;
@@ -1803,10 +1802,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;
@@ -1824,7 +1824,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);
}
--
2.45.2
Powered by blists - more mailing lists