Skip to content

Commit fb9f2e9

Browse files
vladimirolteandavem330
authored andcommitted
net: dsa: tag_sja1105: appease sparse checks for ethertype accessors
A comparison between a value from the packet and an integer constant value needs to be done by converting the value from the packet from net->host, or the constant from host->net. Not the other way around. Even though it makes no practical difference, correct that. Fixes: 38b5bee ("net: dsa: sja1105: prepare tagger for handling DSA tags and VLAN simultaneously") Signed-off-by: Vladimir Oltean <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 51fa960 commit fb9f2e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/dsa/tag_sja1105.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ static bool sja1105_can_use_vlan_as_tags(const struct sk_buff *skb)
7373
{
7474
struct vlan_ethhdr *hdr = vlan_eth_hdr(skb);
7575

76-
if (hdr->h_vlan_proto == ntohs(ETH_P_SJA1105))
76+
if (hdr->h_vlan_proto == htons(ETH_P_SJA1105))
7777
return true;
7878

79-
if (hdr->h_vlan_proto != ntohs(ETH_P_8021Q))
79+
if (hdr->h_vlan_proto != htons(ETH_P_8021Q))
8080
return false;
8181

8282
return vid_is_dsa_8021q(ntohs(hdr->h_vlan_TCI) & VLAN_VID_MASK);

0 commit comments

Comments
 (0)