From 73302d7f7420f359a74f9b7dca37f2484a69371f Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Sat, 26 Apr 2014 18:55:13 +0200 Subject: [PATCH] staging: r8723au: Fix sparse warning in os_dep/os_intfs.c Sparse reports the following: drivers/staging/rtl8723au/os_dep/os_intfs.c:321:14: warning: restricted __be16 degrades to integer Signed-off-by: Larry Finger Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723au/os_dep/os_intfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/os_intfs.c b/drivers/staging/rtl8723au/os_dep/os_intfs.c index 2b2df95923b5..4347896e1df1 100644 --- a/drivers/staging/rtl8723au/os_dep/os_intfs.c +++ b/drivers/staging/rtl8723au/os_dep/os_intfs.c @@ -311,14 +311,14 @@ static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb, u16 rtw_recv_select_queue23a(struct sk_buff *skb) { struct iphdr *piphdr; + struct ethhdr *eth = (struct ethhdr *)skb->data; unsigned int dscp; - u16 eth_type; + u16 eth_type = get_unaligned_be16(ð->h_proto); u32 priority; u8 *pdata = skb->data; - memcpy(ð_type, pdata + (ETH_ALEN << 1), 2); switch (eth_type) { - case htons(ETH_P_IP): + case ETH_P_IP: piphdr = (struct iphdr *)(pdata + ETH_HLEN); dscp = piphdr->tos & 0xfc; priority = dscp >> 5;