All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: de4x5: Omit check for multicast bit in netdev_for_each_mc_addr
@ 2011-06-29 12:16 Tobias Klauser
  2011-07-01  6:57 ` David Miller
  2011-07-01  7:37 ` [PATCH net-next v2] " Tobias Klauser
  0 siblings, 2 replies; 6+ messages in thread
From: Tobias Klauser @ 2011-06-29 12:16 UTC (permalink / raw)
  To: David S. Miller, Grant Grundler; +Cc: netdev

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 <tklauser@distanz.ch>
---
 drivers/net/tulip/de4x5.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index efaa1d6..0c3151a 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -1954,7 +1954,6 @@ SetMulticastFilter(struct net_device *dev)
     u16 hashcode;
     u32 omr, crc;
     char *pa;
-    unsigned char *addrs;
 
     omr = inl(DE4X5_OMR);
     omr &= ~(OMR_PR | OMR_PM);
@@ -1964,9 +1963,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 +1974,6 @@ SetMulticastFilter(struct net_device *dev)
 		    byte -= 1;
 		}
 		lp->setup_frame[byte] |= bit;
-	    }
 	}
     } else {                                 /* Perfect filtering */
 	netdev_for_each_mc_addr(ha, dev) {
-- 
1.7.5.4


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

* Re: [PATCH net-next] net: de4x5: Omit check for multicast bit in netdev_for_each_mc_addr
  2011-06-29 12:16 [PATCH net-next] net: de4x5: Omit check for multicast bit in netdev_for_each_mc_addr Tobias Klauser
@ 2011-07-01  6:57 ` David Miller
  2011-07-01  7:25   ` Tobias Klauser
  2011-07-01  7:37 ` [PATCH net-next v2] " Tobias Klauser
  1 sibling, 1 reply; 6+ messages in thread
From: David Miller @ 2011-07-01  6:57 UTC (permalink / raw)
  To: tklauser; +Cc: grundler, netdev

From: Tobias Klauser <tklauser@distanz.ch>
Date: Wed, 29 Jun 2011 14:16:00 +0200

> 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 <tklauser@distanz.ch>

Please build test your patches!

> @@ -1954,7 +1954,6 @@ SetMulticastFilter(struct net_device *dev)
>      u16 hashcode;
>      u32 omr, crc;
>      char *pa;
> -    unsigned char *addrs;
>  
>      omr = inl(DE4X5_OMR);
>      omr &= ~(OMR_PR | OMR_PM);

You removed this local variable 'addrs' but you did not remove
all uses of that variable, so the build will fail.

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

* Re: [PATCH net-next] net: de4x5: Omit check for multicast bit in netdev_for_each_mc_addr
  2011-07-01  6:57 ` David Miller
@ 2011-07-01  7:25   ` Tobias Klauser
  2011-07-01  7:31     ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Tobias Klauser @ 2011-07-01  7:25 UTC (permalink / raw)
  To: David Miller; +Cc: grundler, netdev

On 2011-07-01 at 08:57:30 +0200, David Miller <davem@davemloft.net> wrote:
> From: Tobias Klauser <tklauser@distanz.ch>
> Date: Wed, 29 Jun 2011 14:16:00 +0200
> 
> > 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 <tklauser@distanz.ch>
> 
> Please build test your patches!

Sorry for the mess. Here's an updated patch, not removing the addrs
local variable.

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 <tklauser@distanz.ch>
---
 drivers/net/tulip/de4x5.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index efaa1d6..d8db2b6 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) {
-- 
1.7.5.4


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

* Re: [PATCH net-next] net: de4x5: Omit check for multicast bit in netdev_for_each_mc_addr
  2011-07-01  7:25   ` Tobias Klauser
@ 2011-07-01  7:31     ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2011-07-01  7:31 UTC (permalink / raw)
  To: tklauser; +Cc: grundler, netdev

From: Tobias Klauser <tklauser@distanz.ch>
Date: Fri, 1 Jul 2011 09:25:33 +0200

> On 2011-07-01 at 08:57:30 +0200, David Miller <davem@davemloft.net> wrote:
>> From: Tobias Klauser <tklauser@distanz.ch>
>> Date: Wed, 29 Jun 2011 14:16:00 +0200
>> 
>> > 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 <tklauser@distanz.ch>
>> 
>> Please build test your patches!
> 
> Sorry for the mess. Here's an updated patch, not removing the addrs
> local variable.
> 
> 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 <tklauser@distanz.ch>

Do not mix patch submissions into existing discussions.

Please, instead, make a new fresh patch submission.

Otherwise I have to do a lot of work editing your commit
log messages and the headers.

Thanks.

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

* [PATCH net-next v2] net: de4x5: Omit check for multicast bit in netdev_for_each_mc_addr
  2011-06-29 12:16 [PATCH net-next] net: de4x5: Omit check for multicast bit in netdev_for_each_mc_addr Tobias Klauser
  2011-07-01  6:57 ` David Miller
@ 2011-07-01  7:37 ` Tobias Klauser
  2011-07-01  8:51   ` David Miller
  1 sibling, 1 reply; 6+ messages in thread
From: Tobias Klauser @ 2011-07-01  7:37 UTC (permalink / raw)
  To: David S. Miller, Grant Grundler; +Cc: netdev

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 <tklauser@distanz.ch>
---
 drivers/net/tulip/de4x5.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index efaa1d6..d8db2b6 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) {
-- 
1.7.5.4


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

* Re: [PATCH net-next v2] net: de4x5: Omit check for multicast bit in netdev_for_each_mc_addr
  2011-07-01  7:37 ` [PATCH net-next v2] " Tobias Klauser
@ 2011-07-01  8:51   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2011-07-01  8:51 UTC (permalink / raw)
  To: tklauser; +Cc: grundler, netdev

From: Tobias Klauser <tklauser@distanz.ch>
Date: Fri,  1 Jul 2011 09:37:52 +0200

> 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 <tklauser@distanz.ch>

Applied, thanks.

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-29 12:16 [PATCH net-next] net: de4x5: Omit check for multicast bit in netdev_for_each_mc_addr Tobias Klauser
2011-07-01  6:57 ` David Miller
2011-07-01  7:25   ` Tobias Klauser
2011-07-01  7:31     ` David Miller
2011-07-01  7:37 ` [PATCH net-next v2] " Tobias Klauser
2011-07-01  8:51   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.