staging:rtl8192u: Remove macro cpMacAddr - Style
authorJohn Whitmore <johnfwhitmore@gmail.com>
Wed, 8 Aug 2018 21:00:23 +0000 (22:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Aug 2018 17:17:07 +0000 (19:17 +0200)
The macro cpMacAddr implements the same functionality as the
ether_addr_copy function defined in etherdevice.h, as a result the
macro has been removed from the code, and its use replaced with the
function call.

Note that the header comment of the function ether_addr_copy states
that the two byte arrays passed as parameters to the function must
be u16 aligned. Because of this the structure ieee80211_network has
had its member variables re-ordered so that the members bssid and
MBssid are aligned to a u16 boundary.

This is a coding style change which should have no impact on runtime
code execution.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192u/ieee80211/dot11d.h
drivers/staging/rtl8192u/ieee80211/ieee80211.h
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c

index 3bfd7ef..14879bc 100644 (file)
@@ -31,17 +31,13 @@ struct rt_dot11d_info {
        bool enabled; /* dot11MultiDomainCapabilityEnabled */
 };
 
-#define cpMacAddr(des, src)          ((des)[0] = (src)[0], \
-       (des)[1] = (src)[1], (des)[2] = (src)[2], \
-       (des)[3] = (src)[3], (des)[4] = (src)[4], \
-       (des)[5] = (src)[5])
 #define GET_DOT11D_INFO(__pIeeeDev) ((struct rt_dot11d_info *)((__pIeeeDev)->pDot11dInfo))
 
 #define IS_DOT11D_ENABLE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->enabled)
 #define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->country_ie_len > 0)
 
 #define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) ether_addr_equal(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)
-#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)
+#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) ether_addr_copy(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)
 
 #define GET_CIE_WATCHDOG(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->country_ie_watchdog)
 #define RESET_CIE_WATCHDOG(__pIeeeDev) (GET_CIE_WATCHDOG(__pIeeeDev) = 0)
index 3cfeac0..62df6f2 100644 (file)
@@ -1329,8 +1329,13 @@ typedef enum _erp_t {
 
 struct ieee80211_network {
        /* These entries are used to identify a unique network */
-       u8 bssid[ETH_ALEN];
+       u8 bssid[ETH_ALEN];   /* u16 aligned! */
        u8 channel;
+
+       // CCXv4 S59, MBSSID.
+       bool    bMBssidValid;
+       u8      MBssid[ETH_ALEN];    /* u16 aligned! */
+       u8      MBssidMask;
        /* Ensure null-terminated for any debug msgs */
        u8 ssid[IW_ESSID_MAX_SIZE + 1];
        u8 ssid_len;
@@ -1341,10 +1346,6 @@ struct ieee80211_network {
        bool    bCkipSupported;
        bool    bCcxRmEnable;
        u16     CcxRmState[2];
-       // CCXv4 S59, MBSSID.
-       bool    bMBssidValid;
-       u8      MBssidMask;
-       u8      MBssid[6];
        // CCX 2 S38, WLAN Device Version Number element. Annie, 2006-08-20.
        bool    bWithCcxVerNum;
        u8      BssCcxVerNumber;
index 28cae82..2c11d3e 100644 (file)
@@ -1944,7 +1944,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
                                        {
                                                network->bMBssidValid = true;
                                                network->MBssidMask = 0xff << (network->MBssidMask);
-                                               cpMacAddr(network->MBssid, network->bssid);
+                                               ether_addr_copy(network->MBssid, network->bssid);
                                                network->MBssid[5] &= network->MBssidMask;
                                        }
                                        else