netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next-2.6] netdev: bfin_mac: Use is_multicast_ether_addr helper
@ 2011-01-12  9:30 Tobias Klauser
  2011-01-12 16:38 ` [uclinux-dist-devel] " Mike Frysinger
  2011-01-13  2:46 ` [PATCH net-next-2.6] netdev: bfin_mac: Use is_multicast_ether_addr helper David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Tobias Klauser @ 2011-01-12  9:30 UTC (permalink / raw)
  To: Michael Hennerich, uclinux-dist-devel, netdev

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 drivers/net/bfin_mac.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index 0b9fc51..fe75e7a 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -1293,7 +1293,7 @@ static void bfin_mac_multicast_hash(struct net_device *dev)
 		addrs = ha->addr;
 
 		/* skip non-multicast addresses */
-		if (!(*addrs & 1))
+		if (!is_multicast_ether_addr(addrs))
 			continue;
 
 		crc = ether_crc(ETH_ALEN, addrs);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [uclinux-dist-devel] [PATCH net-next-2.6] netdev: bfin_mac: Use is_multicast_ether_addr helper
  2011-01-12  9:30 [PATCH net-next-2.6] netdev: bfin_mac: Use is_multicast_ether_addr helper Tobias Klauser
@ 2011-01-12 16:38 ` Mike Frysinger
  2011-01-12 17:18   ` Joe Perches
  2011-01-13  2:46 ` [PATCH net-next-2.6] netdev: bfin_mac: Use is_multicast_ether_addr helper David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Mike Frysinger @ 2011-01-12 16:38 UTC (permalink / raw)
  To: Tobias Klauser; +Cc: Michael Hennerich, uclinux-dist-devel, netdev

On Wed, Jan 12, 2011 at 04:30, Tobias Klauser wrote:
> --- a/drivers/net/bfin_mac.c
> +++ b/drivers/net/bfin_mac.c
> @@ -1293,7 +1293,7 @@ static void bfin_mac_multicast_hash(struct net_device *dev)
>                addrs = ha->addr;
>
>                /* skip non-multicast addresses */
> -               if (!(*addrs & 1))
> +               if (!is_multicast_ether_addr(addrs))
>                        continue;

looks good to me ...
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [uclinux-dist-devel] [PATCH net-next-2.6] netdev: bfin_mac: Use is_multicast_ether_addr helper
  2011-01-12 16:38 ` [uclinux-dist-devel] " Mike Frysinger
@ 2011-01-12 17:18   ` Joe Perches
  2011-01-13  3:01     ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2011-01-12 17:18 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: Tobias Klauser, Michael Hennerich, uclinux-dist-devel, netdev

On Wed, 2011-01-12 at 11:38 -0500, Mike Frysinger wrote:
> On Wed, Jan 12, 2011 at 04:30, Tobias Klauser wrote:
> > --- a/drivers/net/bfin_mac.c
> > +++ b/drivers/net/bfin_mac.c
> > @@ -1293,7 +1293,7 @@ static void bfin_mac_multicast_hash(struct net_device *dev)
> >                addrs = ha->addr;
> >
> >                /* skip non-multicast addresses */
> > -               if (!(*addrs & 1))
> > +               if (!is_multicast_ether_addr(addrs))
> >                        continue;
> 
> looks good to me ...
> Acked-by: Mike Frysinger <vapier@gentoo.org>

Does a netdev_for_each_mc_addr loop entry really
need to verify that the address is multicast?

Couldn't this just be:

	netdev_for_each_mc_addr(ha, dev) {
		crc = ether_crc(ETH_ALEN, ha->addr);
		crc >>= 26;

		if (crc & 0x20)
			emac_hashhi |= 1 << (crc & 0x1f);
		else
			emac_hashlo |= 1 << (crc & 0x1f);
	}



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next-2.6] netdev: bfin_mac: Use is_multicast_ether_addr helper
  2011-01-12  9:30 [PATCH net-next-2.6] netdev: bfin_mac: Use is_multicast_ether_addr helper Tobias Klauser
  2011-01-12 16:38 ` [uclinux-dist-devel] " Mike Frysinger
@ 2011-01-13  2:46 ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2011-01-13  2:46 UTC (permalink / raw)
  To: tklauser; +Cc: michael.hennerich, uclinux-dist-devel, netdev

From: Tobias Klauser <tklauser@distanz.ch>
Date: Wed, 12 Jan 2011 10:30:11 +0100

> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

Applied.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [uclinux-dist-devel] [PATCH net-next-2.6] netdev: bfin_mac: Use is_multicast_ether_addr helper
  2011-01-12 17:18   ` Joe Perches
@ 2011-01-13  3:01     ` David Miller
  2011-01-13  4:08       ` [PATCH net-next-2.6] netdev: bfin_mac: Remove is_multicast_ether_addr use in netdev_for_each_mc_addr Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2011-01-13  3:01 UTC (permalink / raw)
  To: joe; +Cc: vapier.adi, tklauser, michael.hennerich, uclinux-dist-devel,
	netdev

From: Joe Perches <joe@perches.com>
Date: Wed, 12 Jan 2011 09:18:01 -0800

> On Wed, 2011-01-12 at 11:38 -0500, Mike Frysinger wrote:
>> On Wed, Jan 12, 2011 at 04:30, Tobias Klauser wrote:
>> > --- a/drivers/net/bfin_mac.c
>> > +++ b/drivers/net/bfin_mac.c
>> > @@ -1293,7 +1293,7 @@ static void bfin_mac_multicast_hash(struct net_device *dev)
>> >                addrs = ha->addr;
>> >
>> >                /* skip non-multicast addresses */
>> > -               if (!(*addrs & 1))
>> > +               if (!is_multicast_ether_addr(addrs))
>> >                        continue;
>> 
>> looks good to me ...
>> Acked-by: Mike Frysinger <vapier@gentoo.org>
> 
> Does a netdev_for_each_mc_addr loop entry really
> need to verify that the address is multicast?
> 
> Couldn't this just be:

It could, and I'd be happy to apply a follow-on patch that does
this.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH net-next-2.6] netdev: bfin_mac: Remove is_multicast_ether_addr use in netdev_for_each_mc_addr
  2011-01-13  3:01     ` David Miller
@ 2011-01-13  4:08       ` Joe Perches
  2011-01-14  5:51         ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2011-01-13  4:08 UTC (permalink / raw)
  To: David Miller
  Cc: vapier.adi, tklauser, michael.hennerich, uclinux-dist-devel,
	netdev

Remove code that has no effect.

Signed-off-by: Joe Perches <joe@perches.com>

---

Uncompiled, untested...

> > Does a netdev_for_each_mc_addr loop entry really
> > need to verify that the address is multicast?
> > Couldn't this just be:
> It could, and I'd be happy to apply a follow-on patch that does
> this.

 drivers/net/bfin_mac.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index fe75e7a..22abfb3 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -1284,19 +1284,12 @@ static void bfin_mac_multicast_hash(struct net_device *dev)
 {
 	u32 emac_hashhi, emac_hashlo;
 	struct netdev_hw_addr *ha;
-	char *addrs;
 	u32 crc;
 
 	emac_hashhi = emac_hashlo = 0;
 
 	netdev_for_each_mc_addr(ha, dev) {
-		addrs = ha->addr;
-
-		/* skip non-multicast addresses */
-		if (!is_multicast_ether_addr(addrs))
-			continue;
-
-		crc = ether_crc(ETH_ALEN, addrs);
+		crc = ether_crc(ETH_ALEN, ha->addr);
 		crc >>= 26;
 
 		if (crc & 0x20)





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next-2.6] netdev: bfin_mac: Remove is_multicast_ether_addr use in netdev_for_each_mc_addr
  2011-01-13  4:08       ` [PATCH net-next-2.6] netdev: bfin_mac: Remove is_multicast_ether_addr use in netdev_for_each_mc_addr Joe Perches
@ 2011-01-14  5:51         ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2011-01-14  5:51 UTC (permalink / raw)
  To: joe; +Cc: vapier.adi, tklauser, michael.hennerich, uclinux-dist-devel,
	netdev

From: Joe Perches <joe@perches.com>
Date: Wed, 12 Jan 2011 20:08:04 -0800

> Remove code that has no effect.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Applied.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-01-14  5:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-12  9:30 [PATCH net-next-2.6] netdev: bfin_mac: Use is_multicast_ether_addr helper Tobias Klauser
2011-01-12 16:38 ` [uclinux-dist-devel] " Mike Frysinger
2011-01-12 17:18   ` Joe Perches
2011-01-13  3:01     ` David Miller
2011-01-13  4:08       ` [PATCH net-next-2.6] netdev: bfin_mac: Remove is_multicast_ether_addr use in netdev_for_each_mc_addr Joe Perches
2011-01-14  5:51         ` David Miller
2011-01-13  2:46 ` [PATCH net-next-2.6] netdev: bfin_mac: Use is_multicast_ether_addr helper David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).