From e77aeb71f04ed236fffe5f347e208c8b0e92d48a Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 30 Jun 2011 21:37:52 +0000 Subject: net: de4x5: Omit check for multicast bit in netdev_for_each_mc_addr There is no need to check for the address being a multicast address in the netdev_for_each_mc_addr loop, so remove it. Signed-off-by: Tobias Klauser Signed-off-by: David S. Miller --- drivers/net/tulip/de4x5.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers/net/tulip/de4x5.c') diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c index efaa1d69b72..d8db2b664ac 100644 --- a/drivers/net/tulip/de4x5.c +++ b/drivers/net/tulip/de4x5.c @@ -1964,9 +1964,7 @@ SetMulticastFilter(struct net_device *dev) omr |= OMR_PM; /* Pass all multicasts */ } else if (lp->setup_f == HASH_PERF) { /* Hash Filtering */ netdev_for_each_mc_addr(ha, dev) { - addrs = ha->addr; - if ((*addrs & 0x01) == 1) { /* multicast address? */ - crc = ether_crc_le(ETH_ALEN, addrs); + crc = ether_crc_le(ETH_ALEN, ha->addr); hashcode = crc & HASH_BITS; /* hashcode is 9 LSb of CRC */ byte = hashcode >> 3; /* bit[3-8] -> byte in filter */ @@ -1977,7 +1975,6 @@ SetMulticastFilter(struct net_device *dev) byte -= 1; } lp->setup_frame[byte] |= bit; - } } } else { /* Perfect filtering */ netdev_for_each_mc_addr(ha, dev) { -- cgit v1.2.3-70-g09d2 From 29a40f0676c9388a83396306957f11b359c4be1c Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 3 Jul 2011 23:48:13 +0000 Subject: net: de4x5: Use helpers from linux/etherdevice.h Signed-off-by: Tobias Klauser Signed-off-by: David S. Miller --- drivers/net/tulip/de4x5.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers/net/tulip/de4x5.c') diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c index d8db2b664ac..959b41021a6 100644 --- a/drivers/net/tulip/de4x5.c +++ b/drivers/net/tulip/de4x5.c @@ -1868,14 +1868,13 @@ de4x5_local_stats(struct net_device *dev, char *buf, int pkt_len) i = DE4X5_PKT_STAT_SZ; } } - if (buf[0] & 0x01) { /* Multicast/Broadcast */ - if ((*(s32 *)&buf[0] == -1) && (*(s16 *)&buf[4] == -1)) { + if (is_multicast_ether_addr(buf)) { + if (is_broadcast_ether_addr(buf)) { lp->pktStats.broadcast++; } else { lp->pktStats.multicast++; } - } else if ((*(s32 *)&buf[0] == *(s32 *)&dev->dev_addr[0]) && - (*(s16 *)&buf[4] == *(s16 *)&dev->dev_addr[4])) { + } else if (compare_ether_addr(buf, dev->dev_addr) == 0) { lp->pktStats.unicast++; } -- cgit v1.2.3-70-g09d2