* [PATCH] au1000_eth.c: use ether_crc() from <linux/crc32.h>
@ 2006-05-01 13:46 Herbert Valerio Riedel
2006-05-02 20:34 ` Ralf Baechle
2006-05-24 5:29 ` Jeff Garzik
0 siblings, 2 replies; 4+ messages in thread
From: Herbert Valerio Riedel @ 2006-05-01 13:46 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linux-mips, sshtylyov
since the au1000 driver already selects the CRC32 routines, simply replace
the internal ether_crc() implementation with the semantically equivalent
one from <linux/crc32.h>
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
---
drivers/net/au1000_eth.c | 18 +-----------------
1 files changed, 1 insertions(+), 17 deletions(-)
9360df5368deaaaa8fc7dcaacf9b7ca446af94c4
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 29adebb..0823cb8 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -52,6 +52,7 @@
#include <linux/mii.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
+#include <linux/crc32.h>
#include <asm/mipsregs.h>
#include <asm/irq.h>
#include <asm/io.h>
@@ -2070,23 +2071,6 @@ static void au1000_tx_timeout(struct net
netif_wake_queue(dev);
}
-
-static unsigned const ethernet_polynomial = 0x04c11db7U;
-static inline u32 ether_crc(int length, unsigned char *data)
-{
- int crc = -1;
-
- while(--length >= 0) {
- unsigned char current_octet = *data++;
- int bit;
- for (bit = 0; bit < 8; bit++, current_octet >>= 1)
- crc = (crc << 1) ^
- ((crc < 0) ^ (current_octet & 1) ?
- ethernet_polynomial : 0);
- }
- return crc;
-}
-
static void set_rx_mode(struct net_device *dev)
{
struct au1000_private *aup = (struct au1000_private *) dev->priv;
--
1.2.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] au1000_eth.c: use ether_crc() from <linux/crc32.h>
@ 2006-05-01 13:46 Herbert Valerio Riedel
0 siblings, 0 replies; 4+ messages in thread
From: Herbert Valerio Riedel @ 2006-05-01 13:46 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linux-mips, sshtylyov
since the au1000 driver already selects the CRC32 routines, simply replace
the internal ether_crc() implementation with the semantically equivalent
one from <linux/crc32.h>
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
---
drivers/net/au1000_eth.c | 18 +-----------------
1 files changed, 1 insertions(+), 17 deletions(-)
9360df5368deaaaa8fc7dcaacf9b7ca446af94c4
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 29adebb..0823cb8 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -52,6 +52,7 @@
#include <linux/mii.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
+#include <linux/crc32.h>
#include <asm/mipsregs.h>
#include <asm/irq.h>
#include <asm/io.h>
@@ -2070,23 +2071,6 @@ static void au1000_tx_timeout(struct net
netif_wake_queue(dev);
}
-
-static unsigned const ethernet_polynomial = 0x04c11db7U;
-static inline u32 ether_crc(int length, unsigned char *data)
-{
- int crc = -1;
-
- while(--length >= 0) {
- unsigned char current_octet = *data++;
- int bit;
- for (bit = 0; bit < 8; bit++, current_octet >>= 1)
- crc = (crc << 1) ^
- ((crc < 0) ^ (current_octet & 1) ?
- ethernet_polynomial : 0);
- }
- return crc;
-}
-
static void set_rx_mode(struct net_device *dev)
{
struct au1000_private *aup = (struct au1000_private *) dev->priv;
--
1.2.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] au1000_eth.c: use ether_crc() from <linux/crc32.h>
2006-05-01 13:46 [PATCH] au1000_eth.c: use ether_crc() from <linux/crc32.h> Herbert Valerio Riedel
@ 2006-05-02 20:34 ` Ralf Baechle
2006-05-24 5:29 ` Jeff Garzik
1 sibling, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2006-05-02 20:34 UTC (permalink / raw)
To: Herbert Valerio Riedel; +Cc: jgarzik, netdev, linux-mips, sshtylyov
On Mon, May 01, 2006 at 01:46:42PM +0000, Herbert Valerio Riedel wrote:
> since the au1000 driver already selects the CRC32 routines, simply replace
> the internal ether_crc() implementation with the semantically equivalent
> one from <linux/crc32.h>
>
> Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Looks good to me.
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Ralf
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] au1000_eth.c: use ether_crc() from <linux/crc32.h>
2006-05-01 13:46 [PATCH] au1000_eth.c: use ether_crc() from <linux/crc32.h> Herbert Valerio Riedel
2006-05-02 20:34 ` Ralf Baechle
@ 2006-05-24 5:29 ` Jeff Garzik
1 sibling, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2006-05-24 5:29 UTC (permalink / raw)
To: Herbert Valerio Riedel; +Cc: netdev, linux-mips, sshtylyov
Herbert Valerio Riedel wrote:
> since the au1000 driver already selects the CRC32 routines, simply replace
> the internal ether_crc() implementation with the semantically equivalent
> one from <linux/crc32.h>
>
> Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
does not apply, please resend
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-05-24 5:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-01 13:46 [PATCH] au1000_eth.c: use ether_crc() from <linux/crc32.h> Herbert Valerio Riedel
2006-05-02 20:34 ` Ralf Baechle
2006-05-24 5:29 ` Jeff Garzik
-- strict thread matches above, loose matches on Subject: below --
2006-05-01 13:46 Herbert Valerio Riedel
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).