* [PATCH net-next] net: dsa: tag_sja1105: appease sparse checks for ethertype accessors
@ 2020-05-13 0:23 Vladimir Oltean
2020-05-13 1:02 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Oltean @ 2020-05-13 0:23 UTC (permalink / raw)
To: andrew, f.fainelli, vivien.didelot; +Cc: davem, netdev
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: 38b5beeae7a4 ("net: dsa: sja1105: prepare tagger for handling DSA tags and VLAN simultaneously")
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
---
net/dsa/tag_sja1105.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/dsa/tag_sja1105.c b/net/dsa/tag_sja1105.c
index ad105550b145..9b4a4d719291 100644
--- a/net/dsa/tag_sja1105.c
+++ b/net/dsa/tag_sja1105.c
@@ -73,10 +73,10 @@ static bool sja1105_can_use_vlan_as_tags(const struct sk_buff *skb)
{
struct vlan_ethhdr *hdr = vlan_eth_hdr(skb);
- if (hdr->h_vlan_proto == ntohs(ETH_P_SJA1105))
+ if (hdr->h_vlan_proto == htons(ETH_P_SJA1105))
return true;
- if (hdr->h_vlan_proto != ntohs(ETH_P_8021Q))
+ if (hdr->h_vlan_proto != htons(ETH_P_8021Q))
return false;
return vid_is_dsa_8021q(ntohs(hdr->h_vlan_TCI) & VLAN_VID_MASK);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: dsa: tag_sja1105: appease sparse checks for ethertype accessors
2020-05-13 0:23 [PATCH net-next] net: dsa: tag_sja1105: appease sparse checks for ethertype accessors Vladimir Oltean
@ 2020-05-13 1:02 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-13 1:02 UTC (permalink / raw)
To: olteanv; +Cc: andrew, f.fainelli, vivien.didelot, netdev
From: Vladimir Oltean <olteanv@gmail.com>
Date: Wed, 13 May 2020 03:23:27 +0300
> 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: 38b5beeae7a4 ("net: dsa: sja1105: prepare tagger for handling DSA tags and VLAN simultaneously")
> Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-13 1:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 0:23 [PATCH net-next] net: dsa: tag_sja1105: appease sparse checks for ethertype accessors Vladimir Oltean
2020-05-13 1:02 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.