From: dingtianhong Date: Thu, 26 Dec 2013 11:41:02 +0000 (+0800) Subject: atm: slight optimization of addr compare X-Git-Tag: MMI-PSA29.97-13-9~12877^2~393^2~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4c55a4623aa0ec6d8af5eec1e58c3015a7025f7b;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git atm: slight optimization of addr compare Use possibly more efficient ether_addr_equal instead of memcmp. Cc: Chas Williams Cc: linux-atm-general@lists.sourceforge.net Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Yang Yingliang Signed-off-by: Ding Tianhong Signed-off-by: David S. Miller --- diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index 5aca5f4c5458..9587e959ce1a 100644 --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c @@ -52,6 +52,7 @@ #include #include #include +#include #include "nicstar.h" #ifdef CONFIG_ATM_NICSTAR_USE_SUNI #include "suni.h" @@ -781,8 +782,7 @@ static int ns_init_card(int i, struct pci_dev *pcidev) if (mac[i] == NULL || !mac_pton(mac[i], card->atmdev->esi)) { nicstar_read_eprom(card->membase, NICSTAR_EPROM_MAC_ADDR_OFFSET, card->atmdev->esi, 6); - if (memcmp(card->atmdev->esi, "\x00\x00\x00\x00\x00\x00", 6) == - 0) { + if (ether_addr_equal(card->atmdev->esi, "\x00\x00\x00\x00\x00\x00")) { nicstar_read_eprom(card->membase, NICSTAR_EPROM_MAC_ADDR_OFFSET_ALT, card->atmdev->esi, 6);