From: dingtianhong Date: Thu, 26 Dec 2013 11:40:27 +0000 (+0800) Subject: net: atl1: slight optimization of addr compare X-Git-Tag: MMI-PSA29.97-13-9~12877^2~393^2~16 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e6d9f8a31c6906f68364487a3540206e7d8d635a;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Cc: Chris Snook Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Weilong Chen Signed-off-by: Ding Tianhong Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c index 538211d6f7d9..55d86ecdacfe 100644 --- a/drivers/net/ethernet/atheros/atlx/atl1.c +++ b/drivers/net/ethernet/atheros/atlx/atl1.c @@ -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);