From: Jes Sorensen Date: Sat, 26 Apr 2014 16:55:41 +0000 (+0200) Subject: staging: rtl8723au: Make rtw_get_capability23a_from_ie() return __le 16 * X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6a235443be58fbdfebb02f536c6338ba82ab399a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging: rtl8723au: Make rtw_get_capability23a_from_ie() return __le 16 * This should make sparse happier. Reported-by: Larry Finger Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_ieee80211.c b/drivers/staging/rtl8723au/core/rtw_ieee80211.c index 8f91bdbc2bbf..7c899d8e6db0 100644 --- a/drivers/staging/rtl8723au/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8723au/core/rtw_ieee80211.c @@ -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; diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index 1f7f061ca1dd..dd42d4f5e7f1 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -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) && */ diff --git a/drivers/staging/rtl8723au/include/rtw_mlme.h b/drivers/staging/rtl8723au/include/rtw_mlme.h index 3d6f7307e41e..55242c2f6636 100644 --- a/drivers/staging/rtl8723au/include/rtw_mlme.h +++ b/drivers/staging/rtl8723au/include/rtw_mlme.h @@ -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); diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 221d15205b1e..14331e474f0b 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -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_;