diff options
author | dingtianhong <dingtianhong@huawei.com> | 2013-12-26 06:41:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-26 13:31:34 -0500 |
commit | 4c55a4623aa0ec6d8af5eec1e58c3015a7025f7b (patch) | |
tree | 959e34a70e3b598d5418dcef2a3f569027214b28 | |
parent | 496d7e8ea3e60289323d24e158b7bce8d0afba2c (diff) |
atm: slight optimization of addr compare
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>
-rw-r--r-- | drivers/atm/nicstar.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 @@ | |||
52 | #include <asm/io.h> | 52 | #include <asm/io.h> |
53 | #include <asm/uaccess.h> | 53 | #include <asm/uaccess.h> |
54 | #include <linux/atomic.h> | 54 | #include <linux/atomic.h> |
55 | #include <linux/etherdevice.h> | ||
55 | #include "nicstar.h" | 56 | #include "nicstar.h" |
56 | #ifdef CONFIG_ATM_NICSTAR_USE_SUNI | 57 | #ifdef CONFIG_ATM_NICSTAR_USE_SUNI |
57 | #include "suni.h" | 58 | #include "suni.h" |
@@ -781,8 +782,7 @@ static int ns_init_card(int i, struct pci_dev *pcidev) | |||
781 | if (mac[i] == NULL || !mac_pton(mac[i], card->atmdev->esi)) { | 782 | if (mac[i] == NULL || !mac_pton(mac[i], card->atmdev->esi)) { |
782 | nicstar_read_eprom(card->membase, NICSTAR_EPROM_MAC_ADDR_OFFSET, | 783 | nicstar_read_eprom(card->membase, NICSTAR_EPROM_MAC_ADDR_OFFSET, |
783 | card->atmdev->esi, 6); | 784 | card->atmdev->esi, 6); |
784 | if (memcmp(card->atmdev->esi, "\x00\x00\x00\x00\x00\x00", 6) == | 785 | if (ether_addr_equal(card->atmdev->esi, "\x00\x00\x00\x00\x00\x00")) { |
785 | 0) { | ||
786 | nicstar_read_eprom(card->membase, | 786 | nicstar_read_eprom(card->membase, |
787 | NICSTAR_EPROM_MAC_ADDR_OFFSET_ALT, | 787 | NICSTAR_EPROM_MAC_ADDR_OFFSET_ALT, |
788 | card->atmdev->esi, 6); | 788 | card->atmdev->esi, 6); |