atm: slight optimization of addr compare
Subsystems (3)
PATCH 5/21 atm: slight optimization of addr compare
Use the recently added and possibly more efficient ether_addr_equal_unaligned to instead of memcmp.
Cc Chas Williams <[email protected]>
Signed-off-by Yang Yingliang <[email protected]>
Signed-off-by Ding Tianhong <[email protected]>
--- drivers/atm/nicstar.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/atm/nicstar.c +1 -2
@@ -781,8 +781,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_unaligned (card->atmdev->esi,"\x00\x00\x00\x00\x00\x00" )) {nicstar_read_eprom (card->membase,NICSTAR_EPROM_MAC_ADDR_OFFSET_ALT , card->atmdev->esi,6 );
Signature · 1 line
1.8.0