staging: vt6656: main_usb.c ether_crc use kernel code
authorMalcolm Priestley <tvboxspy@gmail.com>
Sun, 3 Nov 2013 19:02:41 +0000 (19:02 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Nov 2013 00:33:23 +0000 (16:33 -0800)
use ether_crc already in kernel and remove local version.

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

index 739cda41b5a752b46513d03085dacd03566f0b5f..b7a6e14e4d9fd44cfeec8b89fd3d5a859ed4f134 100644 (file)
@@ -44,6 +44,7 @@
 #include <net/cfg80211.h>
 #include <linux/timer.h>
 #include <linux/usb.h>
+#include <linux/crc32.h>
 
 #ifdef SIOCETHTOOL
 #define DEVICE_ETHTOOL_IOCTL_SUPPORT
index 21805c650319ac23d75afa09a3efd5e245c402d6..4cb7aa737a999bc0f0da70de0f1522795decc382 100644 (file)
@@ -1194,22 +1194,6 @@ out:
        return NETDEV_TX_OK;
 }
 
-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;
-}
-
 /* find out the start position of str2 from str1 */
 static unsigned char *kstrstr(const unsigned char *str1,
                              const unsigned char *str2) {