From: Ebru Akagunduz Date: Fri, 3 Oct 2014 10:08:21 +0000 (+0300) Subject: staging: rtl8188eu: Fix prefer ether_addr_copy() over memcpy() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=6d36fe3edc99165c8d1be60445b807a613d2c918;p=openwrt%2Fstaging%2Fblogic.git staging: rtl8188eu: Fix prefer ether_addr_copy() over memcpy() 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c b/drivers/staging/rtl8188eu/core/rtw_ap.c index 9224e029ef2b..7de7ba197be1 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ap.c +++ b/drivers/staging/rtl8188eu/core/rtw_ap.c @@ -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;