[PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-11 Thread Krzysztof Konopko
Some struct fields in wifi.h are meant to be __le16 bu were declared as unsigned short. This was reported by sparse: rtw_wlan_util.c:538:24: warning: cast to restricted __le16 rtw_wlan_util.c:1544:29: warning: cast to restricted __le16 rtw_wlan_util.c:1546:25: warning: cast to restricted __

[PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Krzysztof Konopko
Some struct fields in wifi.h are meant to be __le16 but were declared as unsigned short. This was reported by sparse: rtw_wlan_util.c:538:24: warning: cast to restricted __le16 rtw_wlan_util.c:1544:29: warning: cast to restricted __le16 rtw_wlan_util.c:1546:25: warning: cast to restricted _

[PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-15 Thread Krzysztof Konopko
Some struct fields in wifi.h are meant to be __le16 but were declared as unsigned short. This was reported by sparse: rtw_wlan_util.c:538:24: warning: cast to restricted __le16 rtw_wlan_util.c:1544:29: warning: cast to restricted __le16 rtw_wlan_util.c:1546:25: warning: cast to restricted _

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-11 Thread Larry Finger
On 12/11/2014 04:23 PM, Krzysztof Konopko wrote: Some struct fields in wifi.h are meant to be __le16 bu were declared as unsigned short. This was reported by sparse: rtw_wlan_util.c:538:24: warning: cast to restricted __le16 rtw_wlan_util.c:1544:29: warning: cast to restricted __le16 r

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Krzysztof Konopko
On 12/12/14 00:53, Larry Finger wrote: > On 12/11/2014 04:23 PM, Krzysztof Konopko wrote: >> Some struct fields in wifi.h are meant to be __le16 bu were declared as >> unsigned short. This was reported by sparse: >> >>rtw_wlan_util.c:538:24: warning: cast to restricted __le16 >>rtw_wlan_ut

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Dan Carpenter
On Thu, Dec 11, 2014 at 05:53:30PM -0600, Larry Finger wrote: > On 12/11/2014 04:23 PM, Krzysztof Konopko wrote: > >Some struct fields in wifi.h are meant to be __le16 bu were declared as > >unsigned short. This was reported by sparse: > > > > rtw_wlan_util.c:538:24: warning: cast to restricted

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Johannes Berg
On Fri, 2014-12-12 at 12:35 +0100, Krzysztof Konopko wrote: > I'm _far_ from being a wireless expert but doesn't data coming out of > the wire/air have the endianess defined explicitly? And both `AC_param` > and `ADDBA_request` come out of air? In general, data in 802.11 frames is little endian.

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Larry Finger
On 12/12/2014 06:52 AM, Dan Carpenter wrote: On Thu, Dec 11, 2014 at 05:53:30PM -0600, Larry Finger wrote: On 12/11/2014 04:23 PM, Krzysztof Konopko wrote: Some struct fields in wifi.h are meant to be __le16 bu were declared as unsigned short. This was reported by sparse: rtw_wlan_util.c:5

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Jes Sorensen
Krzysztof Konopko writes: > On 12/12/14 00:53, Larry Finger wrote: >> In RTL8188EU, both BA_starting_seqctrl and TXOP_limit are unsigned short. >> > > That's not quite the case. `TXOP_limit` is __le16 in RTL8188EU [1]. > It's __le16 even in your GitHub repo [2]. And that made me thinking > that

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Jes Sorensen
Krzysztof Konopko writes: > Some struct fields in wifi.h are meant to be __le16 bu were declared as > unsigned short. This was reported by sparse: > > rtw_wlan_util.c:538:24: warning: cast to restricted __le16 > rtw_wlan_util.c:1544:29: warning: cast to restricted __le16 > rtw_wlan_util.c:1

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Larry Finger
On 12/12/2014 05:35 AM, Krzysztof Konopko wrote: On 12/12/14 00:53, Larry Finger wrote: This fix may make the sparse warnings go away, but I think it introduces new bugs. Right, I see. Nice try though, isn't it? ;) In particular, did you test on big-endian hardware after you made this chan

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Jes Sorensen
Larry Finger writes: > On 12/12/2014 05:35 AM, Krzysztof Konopko wrote: >> I was hunting particularly for inconsistencies with `sparse` and came >> across this one. But I dug a bit further and I wonder why the driver is >> not using standard stuff like the one in `include/linux/ieee80211.h` >> wh

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Krzysztof Konopko
On 12/12/14 17:43, Larry Finger wrote: > On 12/12/2014 06:52 AM, Dan Carpenter wrote: >> On Thu, Dec 11, 2014 at 05:53:30PM -0600, Larry Finger wrote: >>> On 12/11/2014 04:23 PM, Krzysztof Konopko wrote: Some struct fields in wifi.h are meant to be __le16 bu were declared as unsigned shor

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Krzysztof Konopko
On 12/12/14 18:12, Jes Sorensen wrote: > Krzysztof Konopko writes: >> Some struct fields in wifi.h are meant to be __le16 bu were declared as >> unsigned short. This was reported by sparse: >> >> rtw_wlan_util.c:538:24: warning: cast to restricted __le16 >> rtw_wlan_util.c:1544:29: warning: c

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Krzysztof Konopko
On 12/12/14 18:35, Larry Finger wrote: > On 12/12/2014 05:35 AM, Krzysztof Konopko wrote: >> On 12/12/14 00:53, Larry Finger wrote: >>> In particular, did you test on big-endian hardware after you >>> made this change? >> >> Nope. I don't have any big-endian hardware. I don't even have the >> wir

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Krzysztof Konopko
On 12/12/14 19:52, Jes Sorensen wrote: > Larry Finger writes: >> On 12/12/2014 05:35 AM, Krzysztof Konopko wrote: >>> I was hunting particularly for inconsistencies with `sparse` and came >>> across this one. But I dug a bit further and I wonder why the driver is >>> not using standard stuff like

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Larry Finger
On 12/12/2014 04:50 PM, Krzysztof Konopko wrote: On 12/12/14 18:35, Larry Finger wrote: On 12/12/2014 05:35 AM, Krzysztof Konopko wrote: On 12/12/14 00:53, Larry Finger wrote: In particular, did you test on big-endian hardware after you made this change? Nope. I don't have any big-endian ha

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Joe Perches
On Fri, 2014-12-12 at 23:58 +0100, Krzysztof Konopko wrote: > This patch changes the types of the struct fields involved to be > little-endian which is what is received over the air and consistent with > relevant structs in include/linux/ieee80211.h. [] > diff --git a/drivers/staging/rtl8723au/incl

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-15 Thread Jes Sorensen
Krzysztof Konopko writes: > On 12/12/14 19:52, Jes Sorensen wrote: >> Larry Finger writes: >>> On 12/12/2014 05:35 AM, Krzysztof Konopko wrote: I was hunting particularly for inconsistencies with `sparse` and came across this one. But I dug a bit further and I wonder why the driver is

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-15 Thread Jes Sorensen
Krzysztof Konopko writes: > Some struct fields in wifi.h are meant to be __le16 but were declared as > unsigned short. This was reported by sparse: > > rtw_wlan_util.c:538:24: warning: cast to restricted __le16 > rtw_wlan_util.c:1544:29: warning: cast to restricted __le16 > rtw_wlan_util.c:

Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-15 Thread Jes Sorensen
Krzysztof Konopko writes: > Some struct fields in wifi.h are meant to be __le16 but were declared as > unsigned short. This was reported by sparse: > > rtw_wlan_util.c:538:24: warning: cast to restricted __le16 > rtw_wlan_util.c:1544:29: warning: cast to restricted __le16 > rtw_wlan_util.c: