Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: slicoss: Remove last reference to compare_ether_addr

And use the normal is_<foo>_ether_addr functions and ETH_ALEN too.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Joe Perches and committed by
Greg Kroah-Hartman
ae7d27c0 12a2f3f3

+8 -14
-1
drivers/staging/slicoss/README
··· 14 14 - use net_device_ops 15 15 - use dev->stats rather than adapter->stats 16 16 - don't cast netdev_priv it is already void 17 - - use compare_ether_addr 18 17 - GET RID OF MACROS 19 18 - work on all architectures 20 19 - without CONFIG_X86_64 confusion
+8 -13
drivers/staging/slicoss/slicoss.c
··· 595 595 memcpy(adapter->macaddr, 596 596 card->config.MacInfo[adapter->functionnumber].macaddrA, 597 597 sizeof(struct slic_config_mac)); 598 - if (!(adapter->currmacaddr[0] || adapter->currmacaddr[1] || 599 - adapter->currmacaddr[2] || adapter->currmacaddr[3] || 600 - adapter->currmacaddr[4] || adapter->currmacaddr[5])) { 601 - memcpy(adapter->currmacaddr, adapter->macaddr, 6); 602 - } 603 - if (adapter->netdev) { 598 + if (is_zero_ether_addr(adapter->currmacaddr)) 599 + memcpy(adapter->currmacaddr, adapter->macaddr, 600 + ETH_ALEN); 601 + if (adapter->netdev) 604 602 memcpy(adapter->netdev->dev_addr, adapter->currmacaddr, 605 - 6); 606 - } 603 + ETH_ALEN); 607 604 } 608 605 } 609 606 ··· 764 767 { 765 768 struct net_device *netdev = adapter->netdev; 766 769 u32 opts = adapter->macopts; 767 - u32 *dhost4 = (u32 *)&ether_frame->ether_dhost[0]; 768 - u16 *dhost2 = (u16 *)&ether_frame->ether_dhost[4]; 769 770 770 771 if (opts & MAC_PROMISC) 771 772 return true; 772 773 773 - if ((*dhost4 == 0xFFFFFFFF) && (*dhost2 == 0xFFFF)) { 774 + if (is_broadcast_ether_addr(ether_frame->ether_dhost)) { 774 775 if (opts & MAC_BCAST) { 775 776 adapter->rcv_broadcasts++; 776 777 return true; ··· 777 782 } 778 783 } 779 784 780 - if (ether_frame->ether_dhost[0] & 0x01) { 785 + if (is_multicast_ether_addr(ether_frame->ether_dhost)) { 781 786 if (opts & MAC_ALLMCAST) { 782 787 adapter->rcv_multicasts++; 783 788 netdev->stats.multicast++; ··· 2330 2335 if (mcaddr == NULL) 2331 2336 return 1; 2332 2337 2333 - memcpy(mcaddr->address, address, 6); 2338 + memcpy(mcaddr->address, address, ETH_ALEN); 2334 2339 2335 2340 mcaddr->next = adapter->mcastaddrs; 2336 2341 adapter->mcastaddrs = mcaddr;