staging: vt6656: ETHbIsBufferCrc32Ok replace CRCdwGetCrc32
authorMalcolm Priestley <tvboxspy@gmail.com>
Wed, 21 May 2014 20:09:41 +0000 (21:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 May 2014 12:35:27 +0000 (21:35 +0900)
CRCdwGetCrc32 is a bitwise not of ether_crc_le.

Replace with ether_crc_le.

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

index 1db1e84..ada3e7e 100644 (file)
  */
 bool ETHbIsBufferCrc32Ok(u8 * pbyBuffer, unsigned int cbFrameLength)
 {
-       u32 dwCRC;
+       u32 n_crc = ~ether_crc_le(cbFrameLength - 4, pbyBuffer);
 
-       dwCRC = CRCdwGetCrc32(pbyBuffer, cbFrameLength - 4);
-       if (cpu_to_le32(*((u32 *)(pbyBuffer + cbFrameLength - 4))) != dwCRC)
+       if (le32_to_cpu(*((__le32 *)(pbyBuffer + cbFrameLength - 4))) != n_crc)
                return false;
+
        return true;
 }