Commit 6a235443 authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: Make rtw_get_capability23a_from_ie() return __le 16 *

This should make sparse happier.
Reported-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 46ea7726
......@@ -1004,8 +1004,8 @@ void rtw_get_bcn_info23a(struct wlan_network *pnetwork)
unsigned int len;
unsigned char *p;
memcpy(&cap, rtw_get_capability23a_from_ie(pnetwork->network.IEs), 2);
cap = le16_to_cpu(cap);
cap = get_unaligned_le16(
rtw_get_capability23a_from_ie(pnetwork->network.IEs));
if (cap & WLAN_CAPABILITY_PRIVACY) {
bencrypt = 1;
pnetwork->network.Privacy = 1;
......
......@@ -333,9 +333,9 @@ void rtw23a_roaming(struct rtw_adapter *padapter,
spin_unlock_bh(&pmlmepriv->lock);
}
u8 *rtw_get_capability23a_from_ie(u8 *ie)
__le16 *rtw_get_capability23a_from_ie(u8 *ie)
{
return ie + 8 + 2;
return (__le16 *)(ie + 8 + 2);
}
u16 rtw_get_capability23a(struct wlan_bssid_ex *bss)
......@@ -416,11 +416,8 @@ int is_same_network23a(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst)
{
u16 s_cap, d_cap;
memcpy(&s_cap, rtw_get_capability23a_from_ie(src->IEs), 2);
memcpy(&d_cap, rtw_get_capability23a_from_ie(dst->IEs), 2);
s_cap = le16_to_cpu(s_cap);
d_cap = le16_to_cpu(d_cap);
s_cap = get_unaligned_le16(rtw_get_capability23a_from_ie(src->IEs));
d_cap = get_unaligned_le16(rtw_get_capability23a_from_ie(dst->IEs));
return ((src->Ssid.ssid_len == dst->Ssid.ssid_len) &&
/* (src->Configuration.DSConfig == dst->Configuration.DSConfig) && */
......
......@@ -469,7 +469,7 @@ int rtw_if_up23a(struct rtw_adapter *padapter);
int rtw_linked_check(struct rtw_adapter *padapter);
u8 *rtw_get_capability23a_from_ie(u8 *ie);
__le16 *rtw_get_capability23a_from_ie(u8 *ie);
u8 *rtw_get_beacon_interval23a_from_ie(u8 *ie);
......
......@@ -292,7 +292,7 @@ static int rtw_cfg80211_inform_bss(struct rtw_adapter *padapter,
le16_to_cpu(*(u16 *)
rtw_get_beacon_interval23a_from_ie(pnetwork->network.IEs));
notify_capability =
le16_to_cpu(*(u16 *)
get_unaligned_le16(
rtw_get_capability23a_from_ie(pnetwork->network.IEs));
notify_ie = pnetwork->network.IEs + _FIXED_IE_LENGTH_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment