diff options
author | Amitoj Kaur Chawla <amitoj1606@gmail.com> | 2016-02-16 19:56:05 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-20 15:06:51 -0800 |
commit | 684d2f100522984c8f0ac494dceb8a90a7a6c429 (patch) | |
tree | c94843311084e9b68d6ccdb166584d00ecbbbc0f /drivers/staging/rtl8188eu | |
parent | da04bf74b499c22e300517beaaab63670835da84 (diff) | |
download | linux-684d2f100522984c8f0ac494dceb8a90a7a6c429.tar.bz2 |
staging: rtl8188eu: core: Use put_unaligned_le16
Introduce the use of function put_unaligned_le16.
This is done using the following Coccinelle semantic patch:
//<smpl>
@@ identifier tmp; expression ptr; expression y,e; type T; @@
- tmp = cpu_to_le16(y);
<+... when != tmp
- memcpy(ptr, (T)&tmp, ...);
+ put_unaligned_le16(y,ptr);
...+>
? tmp = e
@@ type T; identifier tmp; @@
- T tmp;
...when != tmp
//</smpl>
Corresponding header file has been added too.
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu')
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index 96e5c6dc5b7c..e3add4862944 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -20,6 +20,7 @@ #define _RTW_MLME_EXT_C_ #include <linux/ieee80211.h> +#include <asm/unaligned.h> #include <osdep_service.h> #include <drv_types.h> @@ -1027,7 +1028,6 @@ static void issue_assocreq(struct adapter *padapter) unsigned char *pframe, *p; struct rtw_ieee80211_hdr *pwlanhdr; __le16 *fctrl; - __le16 le_tmp; unsigned int i, j, ie_len, index = 0; unsigned char rf_type, bssrate[NumRates], sta_bssrate[NumRates]; struct ndis_802_11_var_ie *pIE; @@ -1073,8 +1073,7 @@ static void issue_assocreq(struct adapter *padapter) /* listen interval */ /* todo: listen interval for power saving */ - le_tmp = cpu_to_le16(3); - memcpy(pframe , (unsigned char *)&le_tmp, 2); + put_unaligned_le16(3, pframe); pframe += 2; pattrib->pktlen += 2; |