Merge branch 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[firefly-linux-kernel-4.4.55.git] / drivers / staging / vt6655 / tether.c
index 28554bf75549e40a2913bf5a6bff87fda297492e..a5dc3c09cfd776a830cd38da1ac69169c7d54855 100644 (file)
@@ -47,8 +47,6 @@
 
 /*---------------------  Export Variables  --------------------------*/
 
-
-
 /*
  * Description: Calculate multicast hash value by CRC32
  *
  * Return Value: Hash value
  *
  */
-unsigned char ETHbyGetHashIndexByCrc32 (unsigned char *pbyMultiAddr)
+unsigned char ETHbyGetHashIndexByCrc32(unsigned char *pbyMultiAddr)
 {
-    int     ii;
-    unsigned char byTmpHash;
-    unsigned char byHash = 0;
+       int     ii;
+       unsigned char byTmpHash;
+       unsigned char byHash = 0;
 
-    // get the least 6-bits from CRC generator
-    byTmpHash = (unsigned char)(CRCdwCrc32(pbyMultiAddr, ETH_ALEN,
-            0xFFFFFFFFL) & 0x3F);
-    // reverse most bit to least bit
-    for (ii = 0; ii < (sizeof(byTmpHash) * 8); ii++) {
-        byHash <<= 1;
-        if (byTmpHash & 0x01)
-            byHash |= 1;
-        byTmpHash >>= 1;
-    }
+       // get the least 6-bits from CRC generator
+       byTmpHash = (unsigned char)(CRCdwCrc32(pbyMultiAddr, ETH_ALEN,
+                                              0xFFFFFFFFL) & 0x3F);
+       // reverse most bit to least bit
+       for (ii = 0; ii < (sizeof(byTmpHash) * 8); ii++) {
+               byHash <<= 1;
+               if (byTmpHash & 0x01)
+                       byHash |= 1;
+               byTmpHash >>= 1;
+       }
 
-    // adjust 6-bits to the right most
-    return (byHash >> 2);
+       // adjust 6-bits to the right most
+       return byHash >> 2;
 }
 
-
 /*
  * Description: Check CRC value of the buffer if Ok or not
  *
@@ -96,14 +93,13 @@ unsigned char ETHbyGetHashIndexByCrc32 (unsigned char *pbyMultiAddr)
  * Return Value: true if ok; false if error.
  *
  */
-bool ETHbIsBufferCrc32Ok (unsigned char *pbyBuffer, unsigned int cbFrameLength)
+bool ETHbIsBufferCrc32Ok(unsigned char *pbyBuffer, unsigned int cbFrameLength)
 {
-    unsigned long dwCRC;
+       unsigned long dwCRC;
 
-    dwCRC = CRCdwGetCrc32(pbyBuffer, cbFrameLength - 4);
-    if (cpu_to_le32(*((unsigned long *)(pbyBuffer + cbFrameLength - 4))) != dwCRC) {
-        return false;
-    }
-    return true;
+       dwCRC = CRCdwGetCrc32(pbyBuffer, cbFrameLength - 4);
+       if (cpu_to_le32(*((unsigned long *)(pbyBuffer + cbFrameLength - 4))) != dwCRC) {
+               return false;
+       }
+       return true;
 }
-