Skip to contentSkip to conversation

staging/rtl8723au fix sparse warning in os_initfs.c

PATCH In review Konrad Zapalowicz 2 participants 2 messages May 15, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging/rtl8723au fix sparse warning in os_initfs.c

This commit fixes the following sparse warning:

drivers/staging/rtl8723au/os_dep/os_intfs.c:
- 322:14: warning: restricted __be16 degrades to integer

---
 drivers/staging/rtl8723au/os_dep/os_intfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723au/os_dep/os_intfs.c +1 -1
index 57eca7a..31a70af 100644
@@ -319,7 +319,7 @@ u16 rtw_recv_select_queue23a(struct sk_buff *skb)
 
 	memcpy(&eth_type, pdata + (ETH_ALEN << 1), 2);
 	switch (eth_type) {
-	case htons(ETH_P_IP):
+	case be16_to_cpu(htons(ETH_P_IP)):
 		piphdr = (struct iphdr *)(pdata + ETH_HLEN);
 		dscp = piphdr->tos & 0xfc;
 		priority = dscp >> 5;
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 15 lines · Konrad Zapalowicz

This commit fixes the following sparse warning:

drivers/staging/rtl8723au/os_dep/os_intfs.c:
- 322:14: warning: restricted __be16 degrades to integer

---
 drivers/staging/rtl8723au/os_dep/os_intfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723au/os_dep/os_intfs.c +0 -0
index 57eca7a..31a70af 100644

drivers/staging/rtl8723au/os_dep/os_intfs.c u16 rtw_recv_select_queue23a(struct sk_buff *skb) · line 322

Quoted 5 lines
drivers/staging/rtl8723au/os_dep/os_intfs.c +1 -1
@@ -319,7 +319,7 @@ u16 rtw_recv_select_queue23a(struct sk_buff *skb)
 
 	memcpy(&eth_type, pdata + (ETH_ALEN << 1), 2);
 	switch (eth_type) {
-	case htons(ETH_P_IP):
+	case be16_to_cpu(htons(ETH_P_IP)):

You should be more careful. This would have just made the code buggy.

Anyway someone already cleaned up this code. You should be working against linux-next.

regards,
dan carpenter