Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755043AbaAHC6P (ORCPT ); Tue, 7 Jan 2014 21:58:15 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:43000 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755001AbaAHCxv (ORCPT ); Tue, 7 Jan 2014 21:53:51 -0500 Message-ID: <52CCBDB3.30009@huawei.com> Date: Wed, 8 Jan 2014 10:53:39 +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: Roland Dreier , Sean Hefty , Hal Rosenstock , Faisal Latif , , "linux-kernel@vger.kernel.org" , Netdev Subject: [PATCH v3.6 09/19] infiniband: slight optimization of addr compare Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.22.246] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the possibly more efficient ether_addr_equal to instead of memcmp. Cc: Roland Dreier Cc: Sean Hefty Cc: Hal Rosenstock Cc: Faisal Latif Cc: linux-rdma@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Wang Weidong Signed-off-by: Ding Tianhong --- drivers/infiniband/hw/nes/nes_cm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 6b29249..9c9f2f5 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c @@ -1354,8 +1354,7 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi neigh->ha, ntohl(rt->rt_gateway)); if (arpindex >= 0) { - if (!memcmp(nesadapter->arp_table[arpindex].mac_addr, - neigh->ha, ETH_ALEN)) { + if (ether_addr_equal(nesadapter->arp_table[arpindex].mac_addr, neigh->ha)) { /* Mac address same as in nes_arp_table */ goto out; } -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/