]> git.baikalelectronics.ru Git - kernel.git/commit
net: systemport: Fix sparse warnings in bcm_sysport_insert_tsb()
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 2 Apr 2018 22:58:56 +0000 (15:58 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Apr 2018 15:07:21 +0000 (11:07 -0400)
commit30e75d0a94131159cce5029eef6c0317238d9d8a
tree60150b002c683c5c21d1001dce04f99d7cfdfffc
parente17e43e7fb9de975d8126202ff7d62fe3bd92a16
net: systemport: Fix sparse warnings in bcm_sysport_insert_tsb()

skb->protocol is a __be16 which we would be calling htons() against,
while this is not wrong per-se as it correctly results in swapping the
value on LE hosts, this still upsets sparse. Adopt a similar pattern to
what other drivers do and just assign ip_ver to skb->protocol, and then
use htons() against the different constants such that the compiler can
resolve the values at build time.

Fixes: 9b2572ce82c3 ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcmsysport.c