The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] staging/rtl8723au fix sparse warning in os_initfs.c
@ 2014-05-15 20:43 Konrad Zapalowicz
  2014-05-15 20:57 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Konrad Zapalowicz @ 2014-05-15 20:43 UTC (permalink / raw)
  To: Larry.Finger; +Cc: gregkh, devel, linux-kernel, 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

Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
---
 drivers/staging/rtl8723au/os_dep/os_intfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723au/os_dep/os_intfs.c b/drivers/staging/rtl8723au/os_dep/os_intfs.c
index 57eca7a..31a70af 100644
--- a/drivers/staging/rtl8723au/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723au/os_dep/os_intfs.c
@@ -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;
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging/rtl8723au fix sparse warning in os_initfs.c
  2014-05-15 20:43 [PATCH] staging/rtl8723au fix sparse warning in os_initfs.c Konrad Zapalowicz
@ 2014-05-15 20:57 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2014-05-15 20:57 UTC (permalink / raw)
  To: Konrad Zapalowicz; +Cc: Larry.Finger, devel, gregkh, linux-kernel

On Thu, May 15, 2014 at 10:43:34PM +0200, Konrad Zapalowicz wrote:
> This commit fixes the following sparse warning:
> 
> drivers/staging/rtl8723au/os_dep/os_intfs.c:
>     - 322:14: warning: restricted __be16 degrades to integer
> 
> Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
> ---
>  drivers/staging/rtl8723au/os_dep/os_intfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8723au/os_dep/os_intfs.c b/drivers/staging/rtl8723au/os_dep/os_intfs.c
> index 57eca7a..31a70af 100644
> --- a/drivers/staging/rtl8723au/os_dep/os_intfs.c
> +++ b/drivers/staging/rtl8723au/os_dep/os_intfs.c
> @@ -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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-15 20:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-15 20:43 [PATCH] staging/rtl8723au fix sparse warning in os_initfs.c Konrad Zapalowicz
2014-05-15 20:57 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox