]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
atm: slight optimization of addr compare
authordingtianhong <dingtianhong@huawei.com>
Thu, 26 Dec 2013 11:41:02 +0000 (19:41 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Dec 2013 18:31:34 +0000 (13:31 -0500)
Use possibly more efficient ether_addr_equal
instead of memcmp.

Cc: Chas Williams <chas@cmf.nrl.navy.mil>
Cc: linux-atm-general@lists.sourceforge.net
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/atm/nicstar.c

index 5aca5f4c545896c567c892716a64b6cb22452b43..9587e959ce1af0cefca7d814ad161aa1c709c9bb 100644 (file)
@@ -52,6 +52,7 @@
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <linux/atomic.h>
+#include <linux/etherdevice.h>
 #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);