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

net: dsa: tag_mtk: Fix warnings for __be16

net/dsa/tag_mtk.c:84:13: warning: incorrect type in assignment (different base types)
net/dsa/tag_mtk.c:84:13: expected restricted __be16 [usertype] hdr
net/dsa/tag_mtk.c:84:13: got int
net/dsa/tag_mtk.c:94:17: warning: restricted __be16 degrades to integer

The result of a ntohs() is not __be16, but u16.

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
04d63f9d 802734ad

+2 -1
+2 -1
net/dsa/tag_mtk.c
··· 67 67 static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev, 68 68 struct packet_type *pt) 69 69 { 70 + u16 hdr; 70 71 int port; 71 - __be16 *phdr, hdr; 72 + __be16 *phdr; 72 73 unsigned char *dest = eth_hdr(skb)->h_dest; 73 74 bool is_multicast_skb = is_multicast_ether_addr(dest) && 74 75 !is_broadcast_ether_addr(dest);