Skip to content

Commit

Permalink
net: hsr: fix incorrect type usage for protocol variable
Browse files Browse the repository at this point in the history
Fix following sparse checker warning:-

net/hsr/hsr_slave.c:38:18: warning: incorrect type in assignment (different base types)
net/hsr/hsr_slave.c:38:18:    expected unsigned short [unsigned] [usertype] protocol
net/hsr/hsr_slave.c:38:18:    got restricted __be16 [usertype] h_proto
net/hsr/hsr_slave.c:39:25: warning: restricted __be16 degrades to integer
net/hsr/hsr_slave.c:39:57: warning: restricted __be16 degrades to integer

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Murali Karicheri authored and David S. Miller committed May 6, 2020
1 parent 29ca3cd commit f5dda31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/hsr/hsr_slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static rx_handler_result_t hsr_handle_frame(struct sk_buff **pskb)
{
struct sk_buff *skb = *pskb;
struct hsr_port *port;
u16 protocol;
__be16 protocol;

if (!skb_mac_header_was_set(skb)) {
WARN_ONCE(1, "%s: skb invalid", __func__);
Expand Down

0 comments on commit f5dda31

Please sign in to comment.