From d48603afda8fdca35cf9be7daeb10bf0adbae986 Mon Sep 17 00:00:00 2001 From: Ross Schmidt Date: Sat, 3 Oct 2020 20:17:41 -0500 Subject: [PATCH] staging: rtl8723bs: replace RTW_GET_LE16 with get_unaligned_le16 Replace RTW_GET_LE16 macro with get_unaligned_le16. Signed-off-by: Ross Schmidt Link: https://lore.kernel.org/r/20201004011743.10750-6-ross.schm.dev@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_ap.c | 5 +++-- drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 4 ++-- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 7 ++++--- drivers/staging/rtl8723bs/include/osdep_service.h | 2 -- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c index a76e813..4f270d5 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ap.c +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c @@ -8,6 +8,7 @@ #include #include +#include extern unsigned char RTW_WPA_OUI[]; extern unsigned char WMM_OUI[]; @@ -995,12 +996,12 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) /* beacon interval */ p = rtw_get_beacon_interval_from_ie(ie);/* ie + 8; 8: TimeStamp, 2: Beacon Interval 2:Capability */ /* pbss_network->Configuration.BeaconPeriod = le16_to_cpu(*(unsigned short*)p); */ - pbss_network->Configuration.BeaconPeriod = RTW_GET_LE16(p); + pbss_network->Configuration.BeaconPeriod = get_unaligned_le16(p); /* capability */ /* cap = *(unsigned short *)rtw_get_capability_from_ie(ie); */ /* cap = le16_to_cpu(cap); */ - cap = RTW_GET_LE16(ie); + cap = get_unaligned_le16(ie); /* SSID */ p = rtw_get_ie( diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c index 977f0ed..3b7a3c2 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c @@ -500,7 +500,7 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis /* pairwise_cipher */ if (left >= 2) { /* count = le16_to_cpu(*(u16*)pos); */ - count = RTW_GET_LE16(pos); + count = get_unaligned_le16(pos); pos += 2; left -= 2; @@ -570,7 +570,7 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi /* pairwise_cipher */ if (left >= 2) { /* count = le16_to_cpu(*(u16*)pos); */ - count = RTW_GET_LE16(pos); + count = get_unaligned_le16(pos); pos += 2; left -= 2; diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 6db6377..b912ad2 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -11,6 +11,7 @@ #include #include #include +#include static struct mlme_handler mlme_sta_tbl[] = { {WIFI_ASSOCREQ, "OnAssocReq", &OnAssocReq}, @@ -1213,7 +1214,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) goto asoc_class2_error; } - capab_info = RTW_GET_LE16(pframe + WLAN_HDR_A3_LEN); + capab_info = get_unaligned_le16(pframe + WLAN_HDR_A3_LEN); /* capab_info = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN)); */ left = pkt_len - (sizeof(struct ieee80211_hdr_3addr) + ie_offset); @@ -1959,7 +1960,7 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra break; case RTW_WLAN_ACTION_ADDBA_RESP: /* ADDBA response */ - status = RTW_GET_LE16(&frame_body[3]); + status = get_unaligned_le16(&frame_body[3]); tid = ((frame_body[5] >> 2) & 0x7); if (status == 0) { @@ -1989,7 +1990,7 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra ~BIT((frame_body[3] >> 4) & 0xf); /* reason_code = frame_body[4] | (frame_body[5] << 8); */ - reason_code = RTW_GET_LE16(&frame_body[4]); + reason_code = get_unaligned_le16(&frame_body[4]); } else if ((frame_body[3] & BIT(3)) == BIT(3)) { tid = (frame_body[3] >> 4) & 0x0F; diff --git a/drivers/staging/rtl8723bs/include/osdep_service.h b/drivers/staging/rtl8723bs/include/osdep_service.h index a26c8db..2f7e166 100644 --- a/drivers/staging/rtl8723bs/include/osdep_service.h +++ b/drivers/staging/rtl8723bs/include/osdep_service.h @@ -152,8 +152,6 @@ extern void rtw_free_netdev(struct net_device * netdev); #define RTW_GET_BE16(a) ((u16) (((a)[0] << 8) | (a)[1])) -#define RTW_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0])) - void rtw_buf_free(u8 **buf, u32 *buf_len); void rtw_buf_update(u8 **buf, u32 *buf_len, u8 *src, u32 src_len); -- 2.7.4