From nobody Thu Oct 9 16:40:32 2025 Received: from glittertind.blackshift.org (glittertind.blackshift.org [116.203.23.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C84E42E6D38 for ; Tue, 17 Jun 2025 13:25:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=116.203.23.228 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750166741; cv=none; b=jiitUWNTc6talMldYadCy/z/Nhg9jnqIVLezcItHncUosdE2fBHoBHGt++b3t0pAgCbL725mFuj+FO+vy5SDTo8o3ALYfB0CUAREjP5fiFPqyFHK27NuX2SBsLQVKOBUaD/yHgih1iozH+aIZWXFOzAU3yS2a8a2O68Fm1Fo5ho= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750166741; c=relaxed/simple; bh=sem55EClJLo7e0sBEpRg90jWZ80rps5L0scKJuN10gc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=b7OOMydWD/ZlgGOnQ8z4VO4Hm0LR4Z7XOSKOK36WN7quWFYCKEKIH2pWvS8R6h1/0cqW4jYYTH0oTc9CqZH1mEj1ApHJRggx6zaNN1ch8Mo3a7/zX7RIYI75oTxBqpu7TZstUMqo3S3mpx+YQU23KVwYM/SRTAw0sV1KLgvT1yU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=none smtp.mailfrom=hardanger.blackshift.org; arc=none smtp.client-ip=116.203.23.228 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=hardanger.blackshift.org Received: from bjornoya.blackshift.org (unknown [IPv6:2003:e3:7f3d:bb00:e2bf:c3f2:96ab:885d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "bjornoya.blackshift.org", Issuer "R10" (verified OK)) by glittertind.blackshift.org (Postfix) with ESMTPS id 3144A66ED6C for ; Tue, 17 Jun 2025 13:25:29 +0000 (UTC) Received: from dspam.blackshift.org (localhost [127.0.0.1]) by bjornoya.blackshift.org (Postfix) with SMTP id 0243E42A853 for ; Tue, 17 Jun 2025 13:25:28 +0000 (UTC) Received: from hardanger.blackshift.org (unknown [172.20.34.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by bjornoya.blackshift.org (Postfix) with ESMTPS id 0B73D42A7AF; Tue, 17 Jun 2025 13:25:22 +0000 (UTC) Received: from hardanger.blackshift.org (localhost [::1]) by hardanger.blackshift.org (OpenSMTPD) with ESMTP id 57c6960e; Tue, 17 Jun 2025 13:25:20 +0000 (UTC) From: Marc Kleine-Budde Date: Tue, 17 Jun 2025 15:24:57 +0200 Subject: [PATCH net-next v3 07/10] net: fec: fec_enet_rx_queue(): replace manual VLAN header calculation with skb_vlan_eth_hdr() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250617-fec-cleanups-v3-7-a57bfb38993f@pengutronix.de> References: <20250617-fec-cleanups-v3-0-a57bfb38993f@pengutronix.de> In-Reply-To: <20250617-fec-cleanups-v3-0-a57bfb38993f@pengutronix.de> To: Wei Fang , Shenwei Wang , Clark Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , Andrew Lunn Cc: imx@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Marc Kleine-Budde , Frank Li , Andrew Lunn X-Mailer: b4 0.15-dev-6f78e X-Developer-Signature: v=1; a=openpgp-sha256; l=1269; i=mkl@pengutronix.de; h=from:subject:message-id; bh=sem55EClJLo7e0sBEpRg90jWZ80rps5L0scKJuN10gc=; b=owGbwMvMwMXIU5J6/+eEiXMYT6slMWQE5uyQ4los48S4VWeh96Xveq8bLe3KPBIvlc9+Vnruy 5JPD/0+dTIaszAwcjHIiimyzP/Nc2N9+or4P6I5n2EGsTKBTGHg4hSAiVS7sf+V3/9vXUFK8Uov sfadzXtl8rnSvyq+6qi2mJ8b/kjAKkKqWDLSY6vZ+/rVJzhzd6q2dM0TZRRW8PvP3hrrwfbk3J/ ZX/3W/OOeu2r7pOxbUls6bpQzcmuvOxWy7N+9A2qLNd0ZFl9w6M/dMddCyyqEe+OKnecFXLufGg dmPY9c6Pc5uSWffb/WtZy/tl+8+r8FHLCQyxMty/6XqcEd7NKhJWqg4rV09uHVvEGedyadUXig+ 15ZImifsvWGyMs8JfLZ05na7Vg+T+K+2NvNdK9oB3/ilvXMpwIXGBxvc5JQEl/AfDk2UylRgDE0 sZDLxEPOPmp37pzst9/Yb+vqTeqeftj4kfB9xv0JTAJzAQ== X-Developer-Key: i=mkl@pengutronix.de; a=openpgp; fpr=C1400BA0B3989E6FBC7D5B5C2B5EE211C58AEA54 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 --- drivers/net/ethernet/freescale/fec_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethern= et/freescale/fec_main.c index 6b456372de9a..f238cb60aa65 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1860,8 +1860,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 =3D - (struct vlan_hdr *) (data + ETH_HLEN); + struct vlan_ethhdr *vlan_header =3D skb_vlan_eth_hdr(skb); vlan_tag =3D ntohs(vlan_header->h_vlan_TCI); =20 vlan_packet_rcvd =3D true; --=20 2.47.2