From: dingtianhong Date: Thu, 26 Dec 2013 11:40:22 +0000 (+0800) Subject: net: pcnet: slight optimization of addr compare X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ebff7b41b67d9ba2efac0eb3fb02fe90dcc75737;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git net: pcnet: slight optimization of addr compare Use possibly more efficient ether_addr_equal to instead of memcmp. Cc: Don Fry Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Ding Tianhong Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c index 38492e0b704e..9339cccfe05a 100644 --- a/drivers/net/ethernet/amd/pcnet32.c +++ b/drivers/net/ethernet/amd/pcnet32.c @@ -1668,7 +1668,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) for (i = 0; i < ETH_ALEN; i++) promaddr[i] = inb(ioaddr + i); - if (memcmp(promaddr, dev->dev_addr, ETH_ALEN) || + if (!ether_addr_equal(promaddr, dev->dev_addr) || !is_valid_ether_addr(dev->dev_addr)) { if (is_valid_ether_addr(promaddr)) { if (pcnet32_debug & NETIF_MSG_PROBE) {