staging: vt6655: Use ether_crc in kernel.
authorMalcolm Priestley <tvboxspy@gmail.com>
Sun, 17 Aug 2014 19:42:25 +0000 (20:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Aug 2014 20:47:31 +0000 (13:47 -0700)
ether_crc is already in kernel remove local code and
include linux/crc32.h

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/device.h
drivers/staging/vt6655/device_main.c

index e4c52925a112019d3f96737c0d38d252c76f1105..fadebe969e6a6a9bbc1d3828a2fa3243c6bde6c2 100644 (file)
@@ -49,6 +49,7 @@
 #include <linux/sched.h>
 #include <linux/io.h>
 #include <linux/if.h>
+#include <linux/crc32.h>
 //#include <linux/config.h>
 #include <linux/uaccess.h>
 #include <linux/proc_fs.h>
index a44233c2dd2917735b3be9e2ee1be09ffb4918f2..95460d445623374d2e47a319da2886277028ceb5 100644 (file)
@@ -2561,23 +2561,6 @@ static  irqreturn_t  device_intr(int irq,  void *dev_instance)
        return IRQ_RETVAL(handled);
 }
 
-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;
-}
-
 //2008-8-4 <add> by chester
 static int Config_FileGetParameter(unsigned char *string,
                                   unsigned char *dest, unsigned char *source)