From: navin patidar Date: Sun, 22 Jun 2014 08:51:36 +0000 (+0530) Subject: staging: rtl8188eu: Use cpu_to_le16() insted of RTW_PUT_LE16() X-Git-Tag: firefly_0821_release~176^2~3491^2~1403 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=83a9b6694d1e300ca8240fdf654650dcc096c86f;p=firefly-linux-kernel-4.4.55.git staging: rtl8188eu: Use cpu_to_le16() insted of RTW_PUT_LE16() Signed-off-by: navin patidar Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c index d264847afd0d..54ebf3424572 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c @@ -206,8 +206,8 @@ inline u8 *rtw_set_ie_mesh_ch_switch_parm(u8 *buf, u32 *buf_len, u8 ttl, ie_data[0] = ttl; ie_data[1] = flags; - RTW_PUT_LE16((u8 *)&ie_data[2], reason); - RTW_PUT_LE16((u8 *)&ie_data[4], precedence); + *(u16 *)(ie_data+2) = cpu_to_le16(reason); + *(u16 *)(ie_data+4) = cpu_to_le16(precedence); return rtw_set_ie(buf, 0x118, 6, ie_data, buf_len); } @@ -1310,8 +1310,7 @@ u32 rtw_set_p2p_attr_content(u8 *pbuf, u8 attr_id, u16 attr_len, u8 *pdata_attr) *pbuf = attr_id; - /* u16*)(pbuf + 1) = cpu_to_le16(attr_len); */ - RTW_PUT_LE16(pbuf + 1, attr_len); + *(u16 *)(pbuf + 1) = cpu_to_le16(attr_len); if (pdata_attr) memcpy(pbuf + 3, pdata_attr, attr_len); diff --git a/drivers/staging/rtl8188eu/core/rtw_p2p.c b/drivers/staging/rtl8188eu/core/rtw_p2p.c index c7bceaebd334..6023a85d20e3 100644 --- a/drivers/staging/rtl8188eu/core/rtw_p2p.c +++ b/drivers/staging/rtl8188eu/core/rtw_p2p.c @@ -487,8 +487,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) p2pie[p2pielen++] = P2P_ATTR_CAPABILITY; /* Length: */ - /* u16*) (p2pie + p2pielen) = cpu_to_le16(0x0002); */ - RTW_PUT_LE16(p2pie + p2pielen, 0x0002); + *(u16 *) (p2pie + p2pielen) = cpu_to_le16(0x0002); p2pielen += 2; /* Value: */ @@ -516,19 +515,16 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) p2pie[p2pielen++] = P2P_ATTR_EX_LISTEN_TIMING; /* Length: */ - /* u16*) (p2pie + p2pielen) = cpu_to_le16(0x0004); */ - RTW_PUT_LE16(p2pie + p2pielen, 0x0004); + *(u16 *) (p2pie + p2pielen) = cpu_to_le16(0x0004); p2pielen += 2; /* Value: */ /* Availability Period */ - /* u16*) (p2pie + p2pielen) = cpu_to_le16(0xFFFF); */ - RTW_PUT_LE16(p2pie + p2pielen, 0xFFFF); + *(u16 *) (p2pie + p2pielen) = cpu_to_le16(0xFFFF); p2pielen += 2; /* Availability Interval */ - /* u16*) (p2pie + p2pielen) = cpu_to_le16(0xFFFF); */ - RTW_PUT_LE16(p2pie + p2pielen, 0xFFFF); + *(u16 *) (p2pie + p2pielen) = cpu_to_le16(0xFFFF); p2pielen += 2; @@ -544,8 +540,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) /* Length: */ /* 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) */ /* + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) */ - /* u16*) (p2pie + p2pielen) = cpu_to_le16(21 + pwdinfo->device_name_len); */ - RTW_PUT_LE16(p2pie + p2pielen, 21 + pwdinfo->device_name_len); + *(u16 *) (p2pie + p2pielen) = cpu_to_le16(21 + pwdinfo->device_name_len); p2pielen += 2; /* Value: */ @@ -624,8 +619,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 p2pie[p2pielen++] = P2P_ATTR_CAPABILITY; /* Length: */ - /* u16*) (p2pie + p2pielen) = cpu_to_le16(0x0002); */ - RTW_PUT_LE16(p2pie + p2pielen, 0x0002); + *(u16 *) (p2pie + p2pielen) = cpu_to_le16(0x0002); p2pielen += 2; /* Value: */ @@ -646,8 +640,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 /* Length: */ /* 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) */ /* + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes) */ - /* u16*) (p2pie + p2pielen) = cpu_to_le16(21 + pwdinfo->device_name_len); */ - RTW_PUT_LE16(p2pie + p2pielen, 21 + pwdinfo->device_name_len); + *(u16 *) (p2pie + p2pielen) = cpu_to_le16(21 + pwdinfo->device_name_len); p2pielen += 2; /* Value: */ @@ -703,8 +696,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 p2pie[p2pielen++] = P2P_ATTR_GROUP_ID; /* Length: */ - /* u16*) (p2pie + p2pielen) = cpu_to_le16(ETH_ALEN + ussidlen); */ - RTW_PUT_LE16(p2pie + p2pielen, ETH_ALEN + ussidlen); + *(u16 *) (p2pie + p2pielen) = cpu_to_le16(ETH_ALEN + ussidlen); p2pielen += 2; /* Value: */ diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h b/drivers/staging/rtl8188eu/include/osdep_service.h index bbb46cb8e99c..1fb92c69ad2c 100644 --- a/drivers/staging/rtl8188eu/include/osdep_service.h +++ b/drivers/staging/rtl8188eu/include/osdep_service.h @@ -242,12 +242,6 @@ u64 rtw_modular64(u64 x, u64 y); /* Macros for handling unaligned memory accesses */ -#define RTW_PUT_LE16(a, val) \ - do { \ - (a)[1] = ((u16) (val)) >> 8; \ - (a)[0] = ((u16) (val)) & 0xff; \ - } while (0) - #define RTW_GET_BE24(a) ((((u32) (a)[0]) << 16) | (((u32) (a)[1]) << 8) | \ ((u32) (a)[2]))