From: navin patidar <navin.patidar@gmail.com>
To: gregkh@linuxfoundation.org
Cc: Larry.Finger@lwfinger.net, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org,
navin patidar <navin.patidar@gmail.com>
Subject: [PATCH 28/42] staging: rtl8188eu: Use cpu_to_be16() instead of RTW_PUT_BE16()
Date: Sun, 22 Jun 2014 14:06:34 +0530 [thread overview]
Message-ID: <1403426208-12413-12-git-send-email-navin.patidar@gmail.com> (raw)
In-Reply-To: <1403426208-12413-1-git-send-email-navin.patidar@gmail.com>
Signed-off-by: navin patidar <navin.patidar@gmail.com>
---
drivers/staging/rtl8188eu/core/rtw_p2p.c | 48 ++++++++-------------
drivers/staging/rtl8188eu/include/osdep_service.h | 5 ---
2 files changed, 17 insertions(+), 36 deletions(-)
diff --git a/drivers/staging/rtl8188eu/core/rtw_p2p.c b/drivers/staging/rtl8188eu/core/rtw_p2p.c
index 5bc1937..c7bceae 100644
--- a/drivers/staging/rtl8188eu/core/rtw_p2p.c
+++ b/drivers/staging/rtl8188eu/core/rtw_p2p.c
@@ -82,8 +82,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
*pcur = psta->dev_cap;
pcur++;
- /* u16*)(pcur) = cpu_to_be16(psta->config_methods); */
- RTW_PUT_BE16(pcur, psta->config_methods);
+ *((u16 *)(pcur)) = cpu_to_be16(psta->config_methods);
pcur += 2;
memcpy(pcur, psta->primary_dev_type, 8);
@@ -96,12 +95,10 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
pcur += psta->num_of_secdev_type*8;
if (psta->dev_name_len > 0) {
- /* u16*)(pcur) = cpu_to_be16(WPS_ATTR_DEVICE_NAME); */
- RTW_PUT_BE16(pcur, WPS_ATTR_DEVICE_NAME);
+ *(u16 *)(pcur) = cpu_to_be16(WPS_ATTR_DEVICE_NAME);
pcur += 2;
- /* u16*)(pcur) = cpu_to_be16(psta->dev_name_len); */
- RTW_PUT_BE16(pcur, psta->dev_name_len);
+ *(u16 *)(pcur) = cpu_to_be16(psta->dev_name_len);
pcur += 2;
memcpy(pcur, psta->dev_name, psta->dev_name_len);
@@ -315,15 +312,15 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr,
/* Config Method */
/* Type: */
- RTW_PUT_BE16(wpsie + wpsielen, WPS_ATTR_CONF_METHOD);
+ *(u16 *)(wpsie+wpsielen) = cpu_to_be16(WPS_ATTR_CONF_METHOD);
wpsielen += 2;
/* Length: */
- RTW_PUT_BE16(wpsie + wpsielen, 0x0002);
+ *(u16 *)(wpsie+wpsielen) = cpu_to_be16(0x0002);
wpsielen += 2;
/* Value: */
- RTW_PUT_BE16(wpsie + wpsielen, config_method);
+ *(u16 *)(wpsie+wpsielen) = cpu_to_be16(config_method);
wpsielen += 2;
pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *)wpsie, &pattrib->pktlen);
@@ -558,14 +555,12 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* Config Method */
/* This field should be big endian. Noted by P2P specification. */
- /* u16*) (p2pie + p2pielen) = cpu_to_be16(pwdinfo->supported_wps_cm); */
- RTW_PUT_BE16(p2pie + p2pielen, pwdinfo->supported_wps_cm);
+ *(u16 *) (p2pie + p2pielen) = cpu_to_be16(pwdinfo->supported_wps_cm);
p2pielen += 2;
/* Primary Device Type */
/* Category ID */
- /* u16*) (p2pie + p2pielen) = cpu_to_be16(WPS_PDT_CID_MULIT_MEDIA); */
- RTW_PUT_BE16(p2pie + p2pielen, WPS_PDT_CID_MULIT_MEDIA);
+ *(u16 *) (p2pie + p2pielen) = cpu_to_be16(WPS_PDT_CID_MULIT_MEDIA);
p2pielen += 2;
/* OUI */
@@ -573,8 +568,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
p2pielen += 4;
/* Sub Category ID */
- /* u16*) (p2pie + p2pielen) = cpu_to_be16(WPS_PDT_SCID_MEDIA_SERVER); */
- RTW_PUT_BE16(p2pie + p2pielen, WPS_PDT_SCID_MEDIA_SERVER);
+ *(u16 *) (p2pie + p2pielen) = cpu_to_be16(WPS_PDT_SCID_MEDIA_SERVER);
p2pielen += 2;
/* Number of Secondary Device Types */
@@ -582,13 +576,11 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* Device Name */
/* Type: */
- /* u16*) (p2pie + p2pielen) = cpu_to_be16(WPS_ATTR_DEVICE_NAME); */
- RTW_PUT_BE16(p2pie + p2pielen, WPS_ATTR_DEVICE_NAME);
+ *(u16 *) (p2pie + p2pielen) = cpu_to_be16(WPS_ATTR_DEVICE_NAME);
p2pielen += 2;
/* Length: */
- /* u16*) (p2pie + p2pielen) = cpu_to_be16(pwdinfo->device_name_len); */
- RTW_PUT_BE16(p2pie + p2pielen, pwdinfo->device_name_len);
+ *(u16 *) (p2pie + p2pielen) = cpu_to_be16(pwdinfo->device_name_len);
p2pielen += 2;
/* Value: */
@@ -666,19 +658,16 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8
/* Config Method */
/* This field should be big endian. Noted by P2P specification. */
if (pwdinfo->ui_got_wps_info == P2P_GOT_WPSINFO_PBC) {
- /* u16*) (p2pie + p2pielen) = cpu_to_be16(WPS_CONFIG_METHOD_PBC); */
- RTW_PUT_BE16(p2pie + p2pielen, WPS_CONFIG_METHOD_PBC);
+ *(u16 *) (p2pie + p2pielen) = cpu_to_be16(WPS_CONFIG_METHOD_PBC);
} else {
- /* u16*) (p2pie + p2pielen) = cpu_to_be16(WPS_CONFIG_METHOD_DISPLAY); */
- RTW_PUT_BE16(p2pie + p2pielen, WPS_CONFIG_METHOD_DISPLAY);
+ *(u16 *) (p2pie + p2pielen) = cpu_to_be16(WPS_CONFIG_METHOD_DISPLAY);
}
p2pielen += 2;
/* Primary Device Type */
/* Category ID */
- /* u16*) (p2pie + p2pielen) = cpu_to_be16(WPS_PDT_CID_MULIT_MEDIA); */
- RTW_PUT_BE16(p2pie + p2pielen, WPS_PDT_CID_MULIT_MEDIA);
+ *(u16 *) (p2pie + p2pielen) = cpu_to_be16(WPS_PDT_CID_MULIT_MEDIA);
p2pielen += 2;
/* OUI */
@@ -686,8 +675,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8
p2pielen += 4;
/* Sub Category ID */
- /* u16*) (p2pie + p2pielen) = cpu_to_be16(WPS_PDT_SCID_MEDIA_SERVER); */
- RTW_PUT_BE16(p2pie + p2pielen, WPS_PDT_SCID_MEDIA_SERVER);
+ *(u16 *) (p2pie + p2pielen) = cpu_to_be16(WPS_PDT_SCID_MEDIA_SERVER);
p2pielen += 2;
/* Number of Secondary Device Types */
@@ -695,13 +683,11 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8
/* Device Name */
/* Type: */
- /* u16*) (p2pie + p2pielen) = cpu_to_be16(WPS_ATTR_DEVICE_NAME); */
- RTW_PUT_BE16(p2pie + p2pielen, WPS_ATTR_DEVICE_NAME);
+ *(u16 *) (p2pie + p2pielen) = cpu_to_be16(WPS_ATTR_DEVICE_NAME);
p2pielen += 2;
/* Length: */
- /* u16*) (p2pie + p2pielen) = cpu_to_be16(pwdinfo->device_name_len); */
- RTW_PUT_BE16(p2pie + p2pielen, pwdinfo->device_name_len);
+ *(u16 *) (p2pie + p2pielen) = cpu_to_be16(pwdinfo->device_name_len);
p2pielen += 2;
/* Value: */
diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h b/drivers/staging/rtl8188eu/include/osdep_service.h
index 30613fc..2a5cb20 100644
--- a/drivers/staging/rtl8188eu/include/osdep_service.h
+++ b/drivers/staging/rtl8188eu/include/osdep_service.h
@@ -253,11 +253,6 @@ u64 rtw_modular64(u64 x, u64 y);
/* Macros for handling unaligned memory accesses */
#define RTW_GET_BE16(a) ((u16) (((a)[0] << 8) | (a)[1]))
-#define RTW_PUT_BE16(a, val) \
- do { \
- (a)[0] = ((u16) (val)) >> 8; \
- (a)[1] = ((u16) (val)) & 0xff; \
- } while (0)
#define RTW_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0]))
#define RTW_PUT_LE16(a, val) \
--
1.7.10.4
prev parent reply other threads:[~2014-06-22 8:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-22 8:36 [PATCH 17/42] staging: rtl8188eu:Remove rtw_zmalloc(), wrapper for kzalloc() navin patidar
2014-06-22 8:36 ` [PATCH 18/42] staging: rtl8188eu: Remove unused function rtw_division64() navin patidar
2014-06-22 8:36 ` [PATCH 19/42] staging: rtl8188eu: Remove unused function rtw_get_time_interval_ms() navin patidar
2014-06-22 8:36 ` [PATCH 20/42] staging: rtl8188eu: osdep_service.h: Remove unused macro, enum and variables navin patidar
2014-06-22 8:36 ` [PATCH 21/42] staging: rtl8188eu: Replace rtw_list_delete() with list_del_init() navin patidar
2014-06-22 8:36 ` [PATCH 22/42] staging: rtl8188eu: osdep_service.c: Remove unused macro navin patidar
2014-06-22 8:36 ` [PATCH 23/42] staging: rtl8188eu: Replace _rtw_queue_empty() with list_empty() navin patidar
2014-06-22 8:36 ` [PATCH 24/42] staging: rtl8188eu: Replace _cancel_workitem_sync() with cancel_work_sync() navin patidar
2014-06-22 8:36 ` [PATCH 25/42] staging: rtl8188eu: Remove unused inline function _RND512() navin patidar
2014-06-22 8:36 ` [PATCH 26/42] staging: rtl8188eu: Replace _cancel_timer_ex() with del_timer_sync() navin patidar
2014-06-22 8:36 ` [PATCH 27/42] staging: rtl8188eu: Use cpu_to_be32() instead of RTW_PUT_BE32() navin patidar
2014-06-22 8:36 ` navin patidar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1403426208-12413-12-git-send-email-navin.patidar@gmail.com \
--to=navin.patidar@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®