net: dsa: tag_ksz: Fix __be16 warnings

cpu_to_be16 returns a __be16 value. So what it is assigned to needs to
have the same type to avoid warnings.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Andrew Lunn 2020-07-05 21:30:05 +02:00 committed by David S. Miller
parent a61bf20831
commit ed6444ea03

View File

@ -156,8 +156,9 @@ static struct sk_buff *ksz9477_xmit(struct sk_buff *skb,
{ {
struct dsa_port *dp = dsa_slave_to_port(dev); struct dsa_port *dp = dsa_slave_to_port(dev);
struct sk_buff *nskb; struct sk_buff *nskb;
u16 *tag; __be16 *tag;
u8 *addr; u8 *addr;
u16 val;
nskb = ksz_common_xmit(skb, dev, KSZ9477_INGRESS_TAG_LEN); nskb = ksz_common_xmit(skb, dev, KSZ9477_INGRESS_TAG_LEN);
if (!nskb) if (!nskb)
@ -167,12 +168,12 @@ static struct sk_buff *ksz9477_xmit(struct sk_buff *skb,
tag = skb_put(nskb, KSZ9477_INGRESS_TAG_LEN); tag = skb_put(nskb, KSZ9477_INGRESS_TAG_LEN);
addr = skb_mac_header(nskb); addr = skb_mac_header(nskb);
*tag = BIT(dp->index); val = BIT(dp->index);
if (is_link_local_ether_addr(addr)) if (is_link_local_ether_addr(addr))
*tag |= KSZ9477_TAIL_TAG_OVERRIDE; val |= KSZ9477_TAIL_TAG_OVERRIDE;
*tag = cpu_to_be16(*tag); *tag = cpu_to_be16(val);
return nskb; return nskb;
} }