staging: ks7010: use ether_addr_copy in hostif_mib_get_confirm
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Tue, 24 Apr 2018 13:50:03 +0000 (15:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Apr 2018 13:50:19 +0000 (15:50 +0200)
This commit improves readability changing custom ethernet
addresses copies in favour of using ether_addr_copy() function.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_hostif.c

index b92211f..fac7f8e 100644 (file)
@@ -484,16 +484,9 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
        switch (mib_attribute) {
        case DOT11_MAC_ADDRESS:
                hostif_sme_enqueue(priv, SME_GET_MAC_ADDRESS);
-               memcpy(priv->eth_addr, priv->rxp, ETH_ALEN);
+               ether_addr_copy(priv->eth_addr, priv->rxp);
                priv->mac_address_valid = true;
-               dev->dev_addr[0] = priv->eth_addr[0];
-               dev->dev_addr[1] = priv->eth_addr[1];
-               dev->dev_addr[2] = priv->eth_addr[2];
-               dev->dev_addr[3] = priv->eth_addr[3];
-               dev->dev_addr[4] = priv->eth_addr[4];
-               dev->dev_addr[5] = priv->eth_addr[5];
-               dev->dev_addr[6] = 0x00;
-               dev->dev_addr[7] = 0x00;
+               ether_addr_copy(dev->dev_addr, priv->eth_addr);
                netdev_info(dev, "MAC ADDRESS = %pM\n", priv->eth_addr);
                break;
        case DOT11_PRODUCT_VERSION: