From patchwork Thu Dec 26 11:40:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ding Tianhong X-Patchwork-Id: 305252 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 997542C0084 for ; Thu, 26 Dec 2013 22:47:03 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753457Ab3LZLqp (ORCPT ); Thu, 26 Dec 2013 06:46:45 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:3828 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752845Ab3LZLkv (ORCPT ); Thu, 26 Dec 2013 06:40:51 -0500 Received: from 172.24.2.119 (EHLO szxeml213-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BNS12932; Thu, 26 Dec 2013 19:40:49 +0800 (CST) Received: from SZXEML422-HUB.china.huawei.com (10.82.67.161) by szxeml213-edg.china.huawei.com (172.24.2.30) with Microsoft SMTP Server (TLS) id 14.3.158.1; Thu, 26 Dec 2013 19:40:46 +0800 Received: from [127.0.0.1] (10.135.72.199) by szxeml422-hub.china.huawei.com (10.82.67.161) with Microsoft SMTP Server id 14.3.158.1; Thu, 26 Dec 2013 19:40:46 +0800 Message-ID: <52BC15AB.8080909@huawei.com> Date: Thu, 26 Dec 2013 19:40:27 +0800 From: Ding Tianhong User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Jay Cliburn , Chris Snook , Netdev , "linux-kernel@vger.kernel.org" Subject: [PATCH v3.5 03/19] net: atl1: slight optimization of addr compare X-Originating-IP: [10.135.72.199] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- drivers/net/ethernet/atheros/atlx/atl1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c index 538211d..55d86ec 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);