Use possibly more efficient ether_addr_equal instead of memcmp. Cc: Chas Williams <c...@cmf.nrl.navy.mil> Cc: linux-atm-gene...@lists.sourceforge.net Cc: net...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Yang Yingliang <yangyingli...@huawei.com> Signed-off-by: Ding Tianhong <dingtianh...@huawei.com> --- drivers/atm/nicstar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index 5aca5f4..9587e95 100644 --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c @@ -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); -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/