From patchwork Sat Dec 28 06:18:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ding Tianhong X-Patchwork-Id: 305526 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 845512C00C5 for ; Sat, 28 Dec 2013 17:18:57 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755318Ab3L1GSX (ORCPT ); Sat, 28 Dec 2013 01:18:23 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:42516 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755283Ab3L1GSW (ORCPT ); Sat, 28 Dec 2013 01:18:22 -0500 Received: from 172.24.2.119 (EHLO szxeml205-edg.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id AIN09993; Sat, 28 Dec 2013 14:18:20 +0800 (CST) Received: from SZXEML461-HUB.china.huawei.com (10.82.67.204) by szxeml205-edg.china.huawei.com (172.24.2.58) with Microsoft SMTP Server (TLS) id 14.3.158.1; Sat, 28 Dec 2013 14:18:19 +0800 Received: from [127.0.0.1] (10.135.72.199) by szxeml461-hub.china.huawei.com (10.82.67.204) with Microsoft SMTP Server id 14.3.158.1; Sat, 28 Dec 2013 14:18:17 +0800 Message-ID: <52BE6D28.20002@huawei.com> Date: Sat, 28 Dec 2013 14:18:16 +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: "David S. Miller" , Netdev , "linux-kernel@vger.kernel.org" Subject: [PATCH net-next v2 18/20] net: fddi: 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 possibly more efficient ether_addr_equal to instead of memcmp. Cc: "David S. Miller" Signed-off-by: Ding Tianhong --- drivers/net/fddi/skfp/fplustm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/fddi/skfp/fplustm.c b/drivers/net/fddi/skfp/fplustm.c index d918d8a..7d3779a 100644 --- a/drivers/net/fddi/skfp/fplustm.c +++ b/drivers/net/fddi/skfp/fplustm.c @@ -23,6 +23,7 @@ #include "h/smc.h" #include "h/supern_2.h" #include +#include #ifndef lint static const char ID_sccs[] = "@(#)fplustm.c 1.32 99/02/23 (C) SK " ; @@ -1082,7 +1083,7 @@ static struct s_fpmc* mac_get_mc_table(struct s_smc *smc, slot = tb ; continue ; } - if (memcmp((char *)&tb->a,(char *)own,6)) + if (!ether_addr_equal((char *)&tb->a, (char *)own)) continue ; return tb; }