]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
staging: rtl8188eu: Use get_unaligned_be16() instead of RTW_GET_BE16()
authornavin patidar <navin.patidar@gmail.com>
Sun, 22 Jun 2014 08:51:33 +0000 (14:21 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2014 00:27:14 +0000 (20:27 -0400)
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_ieee80211.c
drivers/staging/rtl8188eu/core/rtw_recv.c
drivers/staging/rtl8188eu/include/osdep_service.h

index ae8895e75b192fddccab5c4d386c294cbf529f36..9eb198aa15f78e089de33ea5e13b60cdbf31763a 100644 (file)
@@ -807,8 +807,8 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id , u8 *buf_at
 
        while (attr_ptr - wps_ie < wps_ielen) {
                /*  4 = 2(Attribute ID) + 2(Length) */
-               u16 attr_id = RTW_GET_BE16(attr_ptr);
-               u16 attr_data_len = RTW_GET_BE16(attr_ptr + 2);
+               u16 attr_id = get_unaligned_be16(attr_ptr);
+               u16 attr_data_len = get_unaligned_be16(attr_ptr + 2);
                u16 attr_len = attr_data_len + 4;
 
                if (attr_id == target_attr_id) {
@@ -1156,8 +1156,8 @@ void dump_wps_ie(u8 *ie, u32 ie_len)
 
        pos += 6;
        while (pos-ie < ie_len) {
-               id = RTW_GET_BE16(pos);
-               len = RTW_GET_BE16(pos + 2);
+               id = get_unaligned_be16(pos);
+               len = get_unaligned_be16(pos + 2);
                DBG_88E("%s ID:0x%04x, LEN:%u\n", __func__, id, len);
                pos += (4+len);
        }
index 56aa8861b90031191dfa3a077184c93694024c20..e0f0765f3c6402992c78f5094c2cb7f50763b67a 100644 (file)
@@ -1644,7 +1644,7 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe)
 
        while (a_len > ETH_HLEN) {
                /* Offset 12 denote 2 mac address */
-               nSubframe_Length = RTW_GET_BE16(pdata + 12);
+               nSubframe_Length = get_unaligned_be16(pdata + 12);
 
                if (a_len < (ETHERNET_HEADER_SIZE + nSubframe_Length)) {
                        DBG_88E("nRemain_Length is %d and nSubframe_Length is : %d\n", a_len, nSubframe_Length);
@@ -1699,7 +1699,7 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe)
        for (i = 0; i < nr_subframes; i++) {
                sub_skb = subframes[i];
                /* convert hdr + possible LLC headers into Ethernet header */
-               eth_type = RTW_GET_BE16(&sub_skb->data[6]);
+               eth_type = get_unaligned_be16(&sub_skb->data[6]);
                if (sub_skb->len >= 8 &&
                    ((!memcmp(sub_skb->data, rtw_rfc1042_header, SNAP_SIZE) &&
                          eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) ||
index 2a5cb2061b3b5dd654141a3217c579ee3ecb65f5..ca0957b412ae337242026376557643f006b7bc7f 100644 (file)
@@ -252,8 +252,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_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0]))
 #define RTW_PUT_LE16(a, val)                   \
        do {                                    \