Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andrew Lunn and committed by
David S. Miller
ed6444ea a61bf208

+5 -4
+5 -4
net/dsa/tag_ksz.c
··· 156 156 { 157 157 struct dsa_port *dp = dsa_slave_to_port(dev); 158 158 struct sk_buff *nskb; 159 - u16 *tag; 159 + __be16 *tag; 160 160 u8 *addr; 161 + u16 val; 161 162 162 163 nskb = ksz_common_xmit(skb, dev, KSZ9477_INGRESS_TAG_LEN); 163 164 if (!nskb) ··· 168 167 tag = skb_put(nskb, KSZ9477_INGRESS_TAG_LEN); 169 168 addr = skb_mac_header(nskb); 170 169 171 - *tag = BIT(dp->index); 170 + val = BIT(dp->index); 172 171 173 172 if (is_link_local_ether_addr(addr)) 174 - *tag |= KSZ9477_TAIL_TAG_OVERRIDE; 173 + val |= KSZ9477_TAIL_TAG_OVERRIDE; 175 174 176 - *tag = cpu_to_be16(*tag); 175 + *tag = cpu_to_be16(val); 177 176 178 177 return nskb; 179 178 }