From f01a96c2f35795df7d1cbcfb510caa33b003bd57 Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Fri, 9 May 2025 16:02:12 +0200 Subject: [PATCH] drivers/ethernet/eth_native_tap: Avoid reusing tag name Don't use the same name for the structure instance and type. As that is a violation of MISRA-C 2012 rule 5.7. Signed-off-by: Alberto Escolar Piedras --- drivers/ethernet/eth_native_tap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ethernet/eth_native_tap.c b/drivers/ethernet/eth_native_tap.c index 27cfeadb530..8507e58c14a 100644 --- a/drivers/ethernet/eth_native_tap.c +++ b/drivers/ethernet/eth_native_tap.c @@ -108,7 +108,7 @@ static struct gptp_hdr *check_gptp_msg(struct net_if *iface, bool is_tx) { uint8_t *msg_start = net_pkt_data(pkt); - struct gptp_hdr *gptp_hdr; + struct gptp_hdr *ghdr; int eth_hlen; struct net_eth_hdr *hdr; @@ -129,12 +129,12 @@ static struct gptp_hdr *check_gptp_msg(struct net_if *iface, return false; } - gptp_hdr = (struct gptp_hdr *)pkt->frags->frags->data; + ghdr = (struct gptp_hdr *)pkt->frags->frags->data; } else { - gptp_hdr = (struct gptp_hdr *)(pkt->frags->data + eth_hlen); + ghdr = (struct gptp_hdr *)(pkt->frags->data + eth_hlen); } - return gptp_hdr; + return ghdr; } static void update_pkt_priority(struct gptp_hdr *hdr, struct net_pkt *pkt)