Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8723au: Fix sparse warnings

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 __le16

This patch updates the types of the fields in `AC_param` and
`ADDBA_request` structs to be consistent with relevant structs in
include/linux/ieee80211.h.

Signed-off-by: Krzysztof Konopko <kris@konagma.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Krzysztof Konopko and committed by
Greg Kroah-Hartman
4ae888b6 3895ed0b

+7 -7
+7 -7
drivers/staging/rtl8723au/include/wifi.h
··· 26 26 ------------------------------------------------------------------------------*/ 27 27 28 28 struct AC_param { 29 - unsigned char ACI_AIFSN; 30 - unsigned char CW; 31 - unsigned short TXOP_limit; 29 + u8 ACI_AIFSN; 30 + u8 CW; 31 + __le16 TXOP_limit; 32 32 } __packed; 33 33 34 34 struct WMM_para_element { ··· 38 38 } __packed; 39 39 40 40 struct ADDBA_request { 41 - unsigned char dialog_token; 42 - unsigned short BA_para_set; 43 - unsigned short BA_timeout_value; 44 - unsigned short BA_starting_seqctrl; 41 + u8 dialog_token; 42 + __le16 BA_para_set; 43 + __le16 BA_timeout_value; 44 + __le16 BA_starting_seqctrl; 45 45 } __packed; 46 46 47 47