/* Count the bits in an unsigned char or a U32 */
-static int yaffs_CountBits(unsigned char x)
+static int yaffs_count_bits(unsigned char x)
{
int r = 0;
while (x) {
return r;
}
-static int yaffs_CountBits32(unsigned x)
+static int yaffs_count_bits32(unsigned x)
{
int r = 0;
while (x) {
}
/* Calculate the ECC for a 256-byte block of data */
-void yaffs_ECCCalculate(const unsigned char *data, unsigned char *ecc)
+void yaffs_ecc_cacl(const unsigned char *data, unsigned char *ecc)
{
unsigned int i;
/* Correct the ECC on a 256 byte block of data */
-int yaffs_ECCCorrect(unsigned char *data, unsigned char *read_ecc,
+int yaffs_ecc_correct(unsigned char *data, unsigned char *read_ecc,
const unsigned char *test_ecc)
{
unsigned char d0, d1, d2; /* deltas */
return 1; /* Corrected the error */
}
- if ((yaffs_CountBits(d0) +
- yaffs_CountBits(d1) +
- yaffs_CountBits(d2)) == 1) {
+ if ((yaffs_count_bits(d0) +
+ yaffs_count_bits(d1) +
+ yaffs_count_bits(d2)) == 1) {
/* Reccoverable error in ecc */
read_ecc[0] = test_ecc[0];
/*
* ECCxxxOther does ECC calcs on arbitrary n bytes of data
*/
-void yaffs_ECCCalculateOther(const unsigned char *data, unsigned nBytes,
+void yaffs_ecc_calc_other(const unsigned char *data, unsigned n_bytes,
yaffs_ECCOther *eccOther)
{
unsigned int i;
unsigned line_parity_prime = 0;
unsigned char b;
- for (i = 0; i < nBytes; i++) {
+ for (i = 0; i < n_bytes; i++) {
b = column_parity_table[*data++];
col_parity ^= b;
eccOther->lineParityPrime = line_parity_prime;
}
-int yaffs_ECCCorrectOther(unsigned char *data, unsigned nBytes,
+int yaffs_ecc_correct_other(unsigned char *data, unsigned n_bytes,
yaffs_ECCOther *read_ecc,
const yaffs_ECCOther *test_ecc)
{
if (cDelta & 0x02)
bit |= 0x01;
- if (lDelta >= nBytes)
+ if (lDelta >= n_bytes)
return -1;
data[lDelta] ^= (1 << bit);
return 1; /* corrected */
}
- if ((yaffs_CountBits32(lDelta) + yaffs_CountBits32(lDeltaPrime) +
- yaffs_CountBits(cDelta)) == 1) {
+ if ((yaffs_count_bits32(lDelta) + yaffs_count_bits32(lDeltaPrime) +
+ yaffs_count_bits(cDelta)) == 1) {
/* Reccoverable error in ecc */
*read_ecc = *test_ecc;