Skip to contentSkip to conversation

net: atl1: slight optimization of addr compare

PATCH In review Ding Tianhong 1 participant 1 message Dec 25, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 3/19 net: atl1: slight optimization of addr compare

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

---
 drivers/net/ethernet/atheros/atlx/atl1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/atheros/atlx/atl1.c +2 -1
index 538211d..55d86ec 100644
@@ -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);
Signature · 1 line
1.8.0