staging: rtl8188eu: Fix prefer ether_addr_copy() over memcpy()
authorEbru Akagunduz <ebru.akagunduz@gmail.com>
Fri, 3 Oct 2014 10:08:21 +0000 (13:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Oct 2014 02:29:12 +0000 (10:29 +0800)
This patch fixes "Prefer ether_addr_copy() over memcpy()
if the Ethernet addresses are __aligned(2)" in rtw_ap.c
Pahole showed that the addresses are aligned.

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_ap.c

index 9224e029ef2b023f48b138216e8972a892b004c7..7de7ba197be1beda540b064c6558c56ce9d7b5bb 100644 (file)
@@ -888,7 +888,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
 
        pbss_network->Rssi = 0;
 
-       memcpy(pbss_network->MacAddress, myid(&(padapter->eeprompriv)), ETH_ALEN);
+       ether_addr_copy(pbss_network->MacAddress, myid(&(padapter->eeprompriv)));
 
        /* beacon interval */
        p = rtw_get_beacon_interval_from_ie(ie);/* 8: TimeStamp, 2: Beacon Interval 2:Capability */
@@ -1164,7 +1164,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
                if (!paclnode->valid) {
                        INIT_LIST_HEAD(&paclnode->list);
 
-                       memcpy(paclnode->addr, addr, ETH_ALEN);
+                       ether_addr_copy(paclnode->addr, addr);
 
                        paclnode->valid = true;