From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754478Ab3L0Gt3 (ORCPT ); Fri, 27 Dec 2013 01:49:29 -0500 Received: from szxga01-in.huawei.com ([119.145.14.64]:40058 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754437Ab3L0Gt0 (ORCPT ); Fri, 27 Dec 2013 01:49:26 -0500 Message-ID: <52BD22DA.5020606@huawei.com> Date: Fri, 27 Dec 2013 14:48:58 +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 14/20] net: renesas: slight optimization of addr compare Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.135.72.199] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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/ethernet/renesas/sh_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index ca742e1..2d00bce 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -2207,7 +2207,7 @@ static int sh_eth_tsu_find_entry(struct net_device *ndev, const u8 *addr) for (i = 0; i < SH_ETH_TSU_CAM_ENTRIES; i++, reg_offset += 8) { sh_eth_tsu_read_entry(reg_offset, c_addr); - if (memcmp(addr, c_addr, ETH_ALEN) == 0) + if (ether_addr_equal(addr, c_addr)) return i; } -- 1.8.0