Commit 91a76baa authored by Emil Tantilov's avatar Emil Tantilov Committed by Jeff Kirsher

ixgbevf: use ether_addr_copy instead of memcpy

replace some instances of memcpy for setting up the mac address with
ether_addr_copy()
Signed-off-by: default avatarEmil Tantilov <emil.s.tantilov@intel.com>
Tested-by: default avatarDarin Miller <darin.j.miller@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent cfbe4dba
...@@ -2260,10 +2260,8 @@ void ixgbevf_reset(struct ixgbevf_adapter *adapter) ...@@ -2260,10 +2260,8 @@ void ixgbevf_reset(struct ixgbevf_adapter *adapter)
} }
if (is_valid_ether_addr(adapter->hw.mac.addr)) { if (is_valid_ether_addr(adapter->hw.mac.addr)) {
memcpy(netdev->dev_addr, adapter->hw.mac.addr, ether_addr_copy(netdev->dev_addr, adapter->hw.mac.addr);
netdev->addr_len); ether_addr_copy(netdev->perm_addr, adapter->hw.mac.addr);
memcpy(netdev->perm_addr, adapter->hw.mac.addr,
netdev->addr_len);
} }
adapter->last_reset = jiffies; adapter->last_reset = jiffies;
...@@ -2659,13 +2657,13 @@ static int ixgbevf_sw_init(struct ixgbevf_adapter *adapter) ...@@ -2659,13 +2657,13 @@ static int ixgbevf_sw_init(struct ixgbevf_adapter *adapter)
else if (is_zero_ether_addr(adapter->hw.mac.addr)) else if (is_zero_ether_addr(adapter->hw.mac.addr))
dev_info(&pdev->dev, dev_info(&pdev->dev,
"MAC address not assigned by administrator.\n"); "MAC address not assigned by administrator.\n");
memcpy(netdev->dev_addr, hw->mac.addr, netdev->addr_len); ether_addr_copy(netdev->dev_addr, hw->mac.addr);
} }
if (!is_valid_ether_addr(netdev->dev_addr)) { if (!is_valid_ether_addr(netdev->dev_addr)) {
dev_info(&pdev->dev, "Assigning random MAC address\n"); dev_info(&pdev->dev, "Assigning random MAC address\n");
eth_hw_addr_random(netdev); eth_hw_addr_random(netdev);
memcpy(hw->mac.addr, netdev->dev_addr, netdev->addr_len); ether_addr_copy(hw->mac.addr, netdev->dev_addr);
} }
/* Enable dynamic interrupt throttling rates */ /* Enable dynamic interrupt throttling rates */
...@@ -3695,8 +3693,8 @@ static int ixgbevf_set_mac(struct net_device *netdev, void *p) ...@@ -3695,8 +3693,8 @@ static int ixgbevf_set_mac(struct net_device *netdev, void *p)
if (!is_valid_ether_addr(addr->sa_data)) if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL; return -EADDRNOTAVAIL;
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); ether_addr_copy(netdev->dev_addr, addr->sa_data);
memcpy(hw->mac.addr, addr->sa_data, netdev->addr_len); ether_addr_copy(hw->mac.addr, addr->sa_data);
spin_lock_bh(&adapter->mbx_lock); spin_lock_bh(&adapter->mbx_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment