Skip to contentSkip to conversation

staging: vt6656: main_usb.c ether_crc use kernel code

PATCH New Malcolm Priestley 1 participant 1 message Nov 3, 2013 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: vt6656: main_usb.c ether_crc use kernel code

use ether_crc already in kernel and remove local version.

---
 drivers/staging/vt6656/device.h   |  1 +
 drivers/staging/vt6656/main_usb.c | 16 ----------------
 2 files changed, 1 insertion(+), 16 deletions(-)
drivers/staging/vt6656/device.h +1 -0
index 739cda4..b7a6e14 100644
@@ -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
drivers/staging/vt6656/main_usb.c +0 -16
index 21805c6..4cb7aa7 100644
@@ -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) {
Signature · 1 line
1.8.3.2