Commit 0b7ccbed authored by Johan Meiring's avatar Johan Meiring Committed by Greg Kroah-Hartman

staging: cxt1e1: sbecrc.c: fixes indentation issues

This commit converts several instances of space-based indentation
to use tabs instead.
Signed-off-by: default avatarJohan Meiring <johanmeiring@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 77c84b29
...@@ -46,23 +46,23 @@ static u_int32_t CRCTable[CRC_TABLE_ENTRIES]; ...@@ -46,23 +46,23 @@ static u_int32_t CRCTable[CRC_TABLE_ENTRIES];
static void static void
genCrcTable (u_int32_t *CRCTable) genCrcTable (u_int32_t *CRCTable)
{ {
int ii, jj; int ii, jj;
u_int32_t crc; u_int32_t crc;
for (ii = 0; ii < CRC_TABLE_ENTRIES; ii++) for (ii = 0; ii < CRC_TABLE_ENTRIES; ii++)
{ {
crc = ii; crc = ii;
for (jj = 8; jj > 0; jj--) for (jj = 8; jj > 0; jj--)
{ {
if (crc & 1) if (crc & 1)
crc = (crc >> 1) ^ CRC32_POLYNOMIAL; crc = (crc >> 1) ^ CRC32_POLYNOMIAL;
else else
crc >>= 1; crc >>= 1;
} }
CRCTable[ii] = crc; CRCTable[ii] = crc;
} }
crcTableInit++; crcTableInit++;
} }
...@@ -86,51 +86,51 @@ genCrcTable (u_int32_t *CRCTable) ...@@ -86,51 +86,51 @@ genCrcTable (u_int32_t *CRCTable)
void void
sbeCrc (u_int8_t *buffer, /* data buffer to crc */ sbeCrc (u_int8_t *buffer, /* data buffer to crc */
u_int32_t count, /* length of block in bytes */ u_int32_t count, /* length of block in bytes */
u_int32_t initialCrc, /* starting CRC */ u_int32_t initialCrc, /* starting CRC */
u_int32_t *result) u_int32_t *result)
{ {
u_int32_t *tbl = 0; u_int32_t *tbl = 0;
u_int32_t temp1, temp2, crc; u_int32_t temp1, temp2, crc;
/* /*
* if table not yet created, do so. Don't care about "extra" time * if table not yet created, do so. Don't care about "extra" time
* checking this every time sbeCrc() is called, since CRC calculations are * checking this every time sbeCrc() is called, since CRC calculations
* already time consuming * are already time consuming
*/ */
if (!crcTableInit) if (!crcTableInit)
{ {
#ifdef STATIC_CRC_TABLE #ifdef STATIC_CRC_TABLE
tbl = &CRCTable; tbl = &CRCTable;
genCrcTable (tbl); genCrcTable (tbl);
#else #else
tbl = (u_int32_t *) OS_kmalloc (CRC_TABLE_ENTRIES * sizeof (u_int32_t)); tbl = (u_int32_t *) OS_kmalloc (CRC_TABLE_ENTRIES * sizeof (u_int32_t));
if (tbl == 0) if (tbl == 0)
{ {
*result = 0; /* dummy up return value due to malloc *result = 0; /* dummy up return value due to malloc
* failure */ * failure */
return; return;
} }
genCrcTable (tbl); genCrcTable (tbl);
#endif #endif
} }
/* inverting bits makes ZMODEM & PKZIP compatible */ /* inverting bits makes ZMODEM & PKZIP compatible */
crc = initialCrc ^ 0xFFFFFFFFL; crc = initialCrc ^ 0xFFFFFFFFL;
while (count-- != 0) while (count-- != 0)
{ {
temp1 = (crc >> 8) & 0x00FFFFFFL; temp1 = (crc >> 8) & 0x00FFFFFFL;
temp2 = tbl[((int) crc ^ *buffer++) & 0xff]; temp2 = tbl[((int) crc ^ *buffer++) & 0xff];
crc = temp1 ^ temp2; crc = temp1 ^ temp2;
} }
crc ^= 0xFFFFFFFFL; crc ^= 0xFFFFFFFFL;
*result = crc; *result = crc;
#ifndef STATIC_CRC_TABLE #ifndef STATIC_CRC_TABLE
crcTableInit = 0; crcTableInit = 0;
OS_kfree (tbl); OS_kfree (tbl);
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment