From 5949fdf1cc667f211694ef7fb4c6d3b21ba89016 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Fri, 27 Oct 2017 15:25:56 -0500 Subject: [PATCH] rtl8723ds: Fix more Sparse errors Signed-off-by: Larry Finger --- core/rtw_wlan_util.c | 40 ++++++++++++++++++++-------------------- include/wifi.h | 20 ++++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index 327938c..1c123f8 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -28,19 +28,19 @@ #define IP_OFFSET 30 #endif -unsigned char ARTHEROS_OUI1[] = {0x00, 0x03, 0x7f}; -unsigned char ARTHEROS_OUI2[] = {0x00, 0x13, 0x74}; +static unsigned char ARTHEROS_OUI1[] = {0x00, 0x03, 0x7f}; +static unsigned char ARTHEROS_OUI2[] = {0x00, 0x13, 0x74}; -unsigned char BROADCOM_OUI1[] = {0x00, 0x10, 0x18}; -unsigned char BROADCOM_OUI2[] = {0x00, 0x0a, 0xf7}; -unsigned char BROADCOM_OUI3[] = {0x00, 0x05, 0xb5}; +static unsigned char BROADCOM_OUI1[] = {0x00, 0x10, 0x18}; +static unsigned char BROADCOM_OUI2[] = {0x00, 0x0a, 0xf7}; +static unsigned char BROADCOM_OUI3[] = {0x00, 0x05, 0xb5}; -unsigned char CISCO_OUI[] = {0x00, 0x40, 0x96}; -unsigned char MARVELL_OUI[] = {0x00, 0x50, 0x43}; -unsigned char RALINK_OUI[] = {0x00, 0x0c, 0x43}; -unsigned char REALTEK_OUI[] = {0x00, 0xe0, 0x4c}; -unsigned char AIRGOCAP_OUI[] = {0x00, 0x0a, 0xf5}; +static unsigned char CISCO_OUI[] = {0x00, 0x40, 0x96}; +static unsigned char MARVELL_OUI[] = {0x00, 0x50, 0x43}; +static unsigned char RALINK_OUI[] = {0x00, 0x0c, 0x43}; +static unsigned char REALTEK_OUI[] = {0x00, 0xe0, 0x4c}; +static unsigned char AIRGOCAP_OUI[] = {0x00, 0x0a, 0xf5}; unsigned char REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20}; @@ -857,7 +857,7 @@ __inline u8 *get_my_bssid(WLAN_BSSID_EX *pnetwork) u16 get_beacon_interval(WLAN_BSSID_EX *bss) { - unsigned short val; + __le16 val; _rtw_memcpy((unsigned char *)&val, rtw_get_beacon_interval_from_ie(bss->IEs), 2); return le16_to_cpu(val); @@ -1195,7 +1195,7 @@ inline bool rtw_sec_camid_is_drv_forbid(struct cam_ctl_t *cam_ctl, u8 id) return 1; } -bool _rtw_sec_camid_is_used(struct cam_ctl_t *cam_ctl, u8 id) +static bool _rtw_sec_camid_is_used(struct cam_ctl_t *cam_ctl, u8 id) { bool ret = _FALSE; @@ -1283,7 +1283,7 @@ inline bool rtw_camid_is_gk(_adapter *adapter, u8 cam_id) return ret; } -bool cam_cache_chk(_adapter *adapter, u8 id, u8 *addr, s16 kid, s8 gk) +static bool cam_cache_chk(_adapter *adapter, u8 id, u8 *addr, s16 kid, s8 gk) { struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); bool ret = _FALSE; @@ -1301,7 +1301,7 @@ exit: return ret; } -s16 _rtw_camid_search(_adapter *adapter, u8 *addr, s16 kid, s8 gk) +static s16 _rtw_camid_search(_adapter *adapter, u8 *addr, s16 kid, s8 gk) { struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; @@ -1341,7 +1341,7 @@ s16 rtw_camid_search(_adapter *adapter, u8 *addr, s16 kid, s8 gk) return cam_id; } -s16 rtw_get_camid(_adapter *adapter, struct sta_info *sta, u8 *addr, s16 kid) +static s16 rtw_get_camid(_adapter *adapter, struct sta_info *sta, u8 *addr, s16 kid) { struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; @@ -1455,7 +1455,7 @@ bitmap_handle: return cam_id; } -void rtw_camid_set(_adapter *adapter, u8 cam_id) +static void rtw_camid_set(_adapter *adapter, u8 cam_id) { struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; @@ -1538,7 +1538,7 @@ inline void rtw_sec_cam_swap(_adapter *adapter, u8 cam_id_a, u8 cam_id_b) } } -s16 rtw_get_empty_cam_entry(_adapter *adapter, u8 start_camid) +static s16 rtw_get_empty_cam_entry(_adapter *adapter, u8 start_camid) { struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl; @@ -1998,8 +1998,8 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) /* Commented by Albert 2010/07/12 */ /* Have to handle the endian issue after copying. */ /* HT_ext_caps didn't be used yet. */ - pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info = le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info); - pmlmeinfo->HT_caps.u.HT_cap_element.HT_ext_caps = le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_ext_caps); + pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info = pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info; + pmlmeinfo->HT_caps.u.HT_cap_element.HT_ext_caps = pmlmeinfo->HT_caps.u.HT_cap_element.HT_ext_caps; rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); @@ -2305,7 +2305,7 @@ int rtw_get_bcn_keys(ADAPTER *Adapter, u8 *pframe, u32 packet_len, _rtw_memset(recv_beacon, 0, sizeof(*recv_beacon)); /* checking capabilities */ - capability = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN + 10)); + capability = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN + 10)); /* checking IEs */ left = packet_len - sizeof(struct rtw_ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_; diff --git a/include/wifi.h b/include/wifi.h index 0144d15..b40e365 100644 --- a/include/wifi.h +++ b/include/wifi.h @@ -376,11 +376,11 @@ enum WIFI_REG_DOMAIN { *(__le16 *)(pbuf) |= cpu_to_le16(type); \ } while (0) -#define GetSequence(pbuf) (cpu_to_le16(*(__le16 *)((SIZE_PTR)(pbuf) + 22)) >> 4) +#define GetSequence(pbuf) (le16_to_cpu(*(__le16 *)((SIZE_PTR)(pbuf) + 22)) >> 4) -#define GetFragNum(pbuf) (cpu_to_le16(*(__le16 *)((SIZE_PTR)(pbuf) + 22)) & 0x0f) +#define GetFragNum(pbuf) (le16_to_cpu(*(__le16 *)((SIZE_PTR)(pbuf) + 22)) & 0x0f) -#define GetTupleCache(pbuf) (cpu_to_le16(*(__le16 *)((SIZE_PTR)(pbuf) + 22))) +#define GetTupleCache(pbuf) (le16_to_cpu(*(__le16 *)((SIZE_PTR)(pbuf) + 22))) #define SetFragNum(pbuf, num) \ do { \ @@ -816,11 +816,11 @@ struct ieee80211_ht_addt_info { struct HT_caps_element { union { struct { - unsigned short HT_caps_info; + __le16 HT_caps_info; unsigned char AMPDU_para; unsigned char MCS_rate[16]; - unsigned short HT_ext_caps; - unsigned int Beamforming_caps; + __le16 HT_ext_caps; + __le16 Beamforming_caps; unsigned char ASEL_caps; } HT_cap_element; unsigned char HT_cap[26]; @@ -836,7 +836,7 @@ struct HT_info_element { struct AC_param { unsigned char ACI_AIFSN; unsigned char CW; - unsigned short TXOP_limit; + __le16 TXOP_limit; } __attribute__((packed)); struct WMM_para_element { @@ -847,9 +847,9 @@ struct WMM_para_element { struct ADDBA_request { unsigned char dialog_token; - unsigned short BA_para_set; - unsigned short BA_timeout_value; - unsigned short BA_starting_seqctrl; + __le16 BA_para_set; + __le16 BA_timeout_value; + __le16 BA_starting_seqctrl; } __attribute__((packed)); typedef enum _HT_CAP_AMPDU_FACTOR {