Skip to content

Commit f01a96c

Browse files
aescolarkartben
authored andcommitted
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 <alberto.escolar.piedras@nordicsemi.no>
1 parent fe70e48 commit f01a96c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/ethernet/eth_native_tap.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static struct gptp_hdr *check_gptp_msg(struct net_if *iface,
108108
bool is_tx)
109109
{
110110
uint8_t *msg_start = net_pkt_data(pkt);
111-
struct gptp_hdr *gptp_hdr;
111+
struct gptp_hdr *ghdr;
112112
int eth_hlen;
113113
struct net_eth_hdr *hdr;
114114

@@ -129,12 +129,12 @@ static struct gptp_hdr *check_gptp_msg(struct net_if *iface,
129129
return false;
130130
}
131131

132-
gptp_hdr = (struct gptp_hdr *)pkt->frags->frags->data;
132+
ghdr = (struct gptp_hdr *)pkt->frags->frags->data;
133133
} else {
134-
gptp_hdr = (struct gptp_hdr *)(pkt->frags->data + eth_hlen);
134+
ghdr = (struct gptp_hdr *)(pkt->frags->data + eth_hlen);
135135
}
136136

137-
return gptp_hdr;
137+
return ghdr;
138138
}
139139

140140
static void update_pkt_priority(struct gptp_hdr *hdr, struct net_pkt *pkt)

0 commit comments

Comments
 (0)