From: Elena Oat Date: Thu, 6 Mar 2014 20:10:32 +0000 (+0200) Subject: Staging: rtl8188eu: Fix warning of prefer ether_addr_copy. X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ba5be646783a101fc1e9af81b9c804901e13d597;p=openwrt%2Fstaging%2Fblogic.git Staging: rtl8188eu: Fix warning of prefer ether_addr_copy. This patch fixes the warning of "Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)" in file rtw_cmd.c. Pahole shows that the addresses are 2-byte aligned. Signed-off-by: Elena Oat Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index a48ea16b3e0e..8c0d2ebd03c5 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -1071,7 +1071,7 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key) ph2c->rsp = (u8 *)psetstakey_rsp; ph2c->rspsz = sizeof(struct set_stakey_rsp); - memcpy(psetstakey_para->addr, sta->hwaddr, ETH_ALEN); + ether_addr_copy(psetstakey_para->addr, sta->hwaddr); if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) psetstakey_para->algorithm = (unsigned char) psecuritypriv->dot11PrivacyAlgrthm; @@ -1132,7 +1132,7 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue) ph2c->rsp = (u8 *)psetstakey_rsp; ph2c->rspsz = sizeof(struct set_stakey_rsp); - memcpy(psetstakey_para->addr, sta->hwaddr, ETH_ALEN); + ether_addr_copy(psetstakey_para->addr, sta->hwaddr); psetstakey_para->algorithm = _NO_PRIVACY_; @@ -1243,7 +1243,7 @@ u8 rtw_setassocsta_cmd(struct adapter *padapter, u8 *mac_addr) ph2c->rsp = (u8 *)psetassocsta_rsp; ph2c->rspsz = sizeof(struct set_assocsta_rsp); - memcpy(psetassocsta_para->addr, mac_addr, ETH_ALEN); + ether_addr_copy(psetassocsta_para->addr, mac_addr); res = rtw_enqueue_cmd(pcmdpriv, ph2c);