Commit 83a9b669 authored by navin patidar's avatar navin patidar Committed by Greg Kroah-Hartman

staging: rtl8188eu: Use cpu_to_le16() insted of RTW_PUT_LE16()

Signed-off-by: default avatarnavin patidar <navin.patidar@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4b49a5b3
...@@ -206,8 +206,8 @@ inline u8 *rtw_set_ie_mesh_ch_switch_parm(u8 *buf, u32 *buf_len, u8 ttl, ...@@ -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[0] = ttl;
ie_data[1] = flags; ie_data[1] = flags;
RTW_PUT_LE16((u8 *)&ie_data[2], reason); *(u16 *)(ie_data+2) = cpu_to_le16(reason);
RTW_PUT_LE16((u8 *)&ie_data[4], precedence); *(u16 *)(ie_data+4) = cpu_to_le16(precedence);
return rtw_set_ie(buf, 0x118, 6, ie_data, buf_len); 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) ...@@ -1310,8 +1310,7 @@ u32 rtw_set_p2p_attr_content(u8 *pbuf, u8 attr_id, u16 attr_len, u8 *pdata_attr)
*pbuf = attr_id; *pbuf = attr_id;
/* u16*)(pbuf + 1) = cpu_to_le16(attr_len); */ *(u16 *)(pbuf + 1) = cpu_to_le16(attr_len);
RTW_PUT_LE16(pbuf + 1, attr_len);
if (pdata_attr) if (pdata_attr)
memcpy(pbuf + 3, pdata_attr, attr_len); memcpy(pbuf + 3, pdata_attr, attr_len);
......
...@@ -487,8 +487,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) ...@@ -487,8 +487,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
p2pie[p2pielen++] = P2P_ATTR_CAPABILITY; p2pie[p2pielen++] = P2P_ATTR_CAPABILITY;
/* Length: */ /* Length: */
/* u16*) (p2pie + p2pielen) = cpu_to_le16(0x0002); */ *(u16 *) (p2pie + p2pielen) = cpu_to_le16(0x0002);
RTW_PUT_LE16(p2pie + p2pielen, 0x0002);
p2pielen += 2; p2pielen += 2;
/* Value: */ /* Value: */
...@@ -516,19 +515,16 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) ...@@ -516,19 +515,16 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
p2pie[p2pielen++] = P2P_ATTR_EX_LISTEN_TIMING; p2pie[p2pielen++] = P2P_ATTR_EX_LISTEN_TIMING;
/* Length: */ /* Length: */
/* u16*) (p2pie + p2pielen) = cpu_to_le16(0x0004); */ *(u16 *) (p2pie + p2pielen) = cpu_to_le16(0x0004);
RTW_PUT_LE16(p2pie + p2pielen, 0x0004);
p2pielen += 2; p2pielen += 2;
/* Value: */ /* Value: */
/* Availability Period */ /* Availability Period */
/* u16*) (p2pie + p2pielen) = cpu_to_le16(0xFFFF); */ *(u16 *) (p2pie + p2pielen) = cpu_to_le16(0xFFFF);
RTW_PUT_LE16(p2pie + p2pielen, 0xFFFF);
p2pielen += 2; p2pielen += 2;
/* Availability Interval */ /* Availability Interval */
/* u16*) (p2pie + p2pielen) = cpu_to_le16(0xFFFF); */ *(u16 *) (p2pie + p2pielen) = cpu_to_le16(0xFFFF);
RTW_PUT_LE16(p2pie + p2pielen, 0xFFFF);
p2pielen += 2; p2pielen += 2;
...@@ -544,8 +540,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) ...@@ -544,8 +540,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* Length: */ /* Length: */
/* 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) */ /* 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) */ /* + 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); */ *(u16 *) (p2pie + p2pielen) = cpu_to_le16(21 + pwdinfo->device_name_len);
RTW_PUT_LE16(p2pie + p2pielen, 21 + pwdinfo->device_name_len);
p2pielen += 2; p2pielen += 2;
/* Value: */ /* Value: */
...@@ -624,8 +619,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 ...@@ -624,8 +619,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8
p2pie[p2pielen++] = P2P_ATTR_CAPABILITY; p2pie[p2pielen++] = P2P_ATTR_CAPABILITY;
/* Length: */ /* Length: */
/* u16*) (p2pie + p2pielen) = cpu_to_le16(0x0002); */ *(u16 *) (p2pie + p2pielen) = cpu_to_le16(0x0002);
RTW_PUT_LE16(p2pie + p2pielen, 0x0002);
p2pielen += 2; p2pielen += 2;
/* Value: */ /* Value: */
...@@ -646,8 +640,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 ...@@ -646,8 +640,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8
/* Length: */ /* Length: */
/* 21 -> P2P Device Address (6bytes) + Config Methods (2bytes) + Primary Device Type (8bytes) */ /* 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) */ /* + 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); */ *(u16 *) (p2pie + p2pielen) = cpu_to_le16(21 + pwdinfo->device_name_len);
RTW_PUT_LE16(p2pie + p2pielen, 21 + pwdinfo->device_name_len);
p2pielen += 2; p2pielen += 2;
/* Value: */ /* Value: */
...@@ -703,8 +696,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 ...@@ -703,8 +696,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8
p2pie[p2pielen++] = P2P_ATTR_GROUP_ID; p2pie[p2pielen++] = P2P_ATTR_GROUP_ID;
/* Length: */ /* Length: */
/* u16*) (p2pie + p2pielen) = cpu_to_le16(ETH_ALEN + ussidlen); */ *(u16 *) (p2pie + p2pielen) = cpu_to_le16(ETH_ALEN + ussidlen);
RTW_PUT_LE16(p2pie + p2pielen, ETH_ALEN + ussidlen);
p2pielen += 2; p2pielen += 2;
/* Value: */ /* Value: */
......
...@@ -242,12 +242,6 @@ u64 rtw_modular64(u64 x, u64 y); ...@@ -242,12 +242,6 @@ u64 rtw_modular64(u64 x, u64 y);
/* Macros for handling unaligned memory accesses */ /* 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) | \ #define RTW_GET_BE24(a) ((((u32) (a)[0]) << 16) | (((u32) (a)[1]) << 8) | \
((u32) (a)[2])) ((u32) (a)[2]))
......
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