Staging: rtl8188eu: Fix warning of prefer ether_addr_copy.
authorElena Oat <oat.elena@gmail.com>
Thu, 6 Mar 2014 20:10:32 +0000 (22:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 22:47:39 +0000 (14:47 -0800)
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 <oat.elena@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_cmd.c

index a48ea16b3e0e9e960d1a8ef0c42bf795c22b7ac4..8c0d2ebd03c59e436afbc149afa440f966510b89 100644 (file)
@@ -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);