net: hns3: Fixes the ether address copy with appropriate API
authorSalil Mehta <salil.mehta@huawei.com>
Tue, 19 Sep 2017 16:17:14 +0000 (17:17 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Sep 2017 23:06:49 +0000 (16:06 -0700)
This patch replaces the ethernet address copy instance with more
appropriate ether_addr_copy() function.

Fixes: 6427264ef330 ("net: hns3: Add HNS3 Acceleration Engine &
Compatibility Layer Support")
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

index eafd9c678162f9146e4bff8be866937ec5c4ad3b..8e172afd48760b6691a0e3b8988321389bd5d7ce 100644 (file)
@@ -1063,8 +1063,7 @@ static int hclge_configure(struct hclge_dev *hdev)
        hdev->base_tqp_pid = 0;
        hdev->rss_size_max = 1;
        hdev->rx_buf_len = cfg.rx_buf_len;
-       for (i = 0; i < ETH_ALEN; i++)
-               hdev->hw.mac.mac_addr[i] = cfg.mac_addr[i];
+       ether_addr_copy(hdev->hw.mac.mac_addr, cfg.mac_addr);
        hdev->hw.mac.media_type = cfg.media_type;
        hdev->hw.mac.phy_addr = cfg.phy_addr;
        hdev->num_desc = cfg.tqp_desc_num;