Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6d9f8a3 authored by dingtianhong's avatar dingtianhong Committed by David S. Miller
Browse files

net: atl1: slight optimization of addr compare



Use the recently added and possibly more efficient
ether_addr_equal_unaligned to instead of memcmp.

Cc: Jay Cliburn <jcliburn@gmail.com>
Cc: Chris Snook <chris.snook@gmail.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarDing Tianhong <dingtianhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ebff7b41
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3122,7 +3122,8 @@ static void atl1_remove(struct pci_dev *pdev)
	 * from the BIOS during POST.  If we've been messing with the MAC
	 * address, we need to save the permanent one.
	 */
	if (memcmp(adapter->hw.mac_addr, adapter->hw.perm_mac_addr, ETH_ALEN)) {
	if (!ether_addr_equal_unaligned(adapter->hw.mac_addr,
					adapter->hw.perm_mac_addr)) {
		memcpy(adapter->hw.mac_addr, adapter->hw.perm_mac_addr,
			ETH_ALEN);
		atl1_set_mac_addr(&adapter->hw);