diff --git a/storage/blockdevice/COMPONENT_SPINAND/source/bch.c b/storage/blockdevice/COMPONENT_SPINAND/source/bch.c index 1ae3bb3e4085..850020d9c22a 100644 --- a/storage/blockdevice/COMPONENT_SPINAND/source/bch.c +++ b/storage/blockdevice/COMPONENT_SPINAND/source/bch.c @@ -48,7 +48,7 @@ void bch_encode(struct bch_code *bch, unsigned char *data, unsigned int *ecc) t[0] = bch->mod_tab; for (i = 1; i < 16; i++) { - t[i] = t[i-1] + 4 * (bch->ecc_words); + t[i] = t[i - 1] + 4 * (bch->ecc_words); } memset(bch->ecc, 0, bch->ecc_words * sizeof(*bch->ecc)); @@ -116,8 +116,8 @@ static void build_syndrome(struct bch_code *bch) ecc_bits = i; while (*ecc) { if (*ecc & (unsigned int)1) { - for (j = 0; j < 2*bch->t; j++) { - bch->syn[j] ^= bch->a_pow[mod(bch, (j+1)*i)]; + for (j = 0; j < 2 * bch->t; j++) { + bch->syn[j] ^= bch->a_pow[mod(bch, (j + 1) * i)]; } } *ecc >>= 1; @@ -187,7 +187,7 @@ static int chien_search(struct bch_code *bch, unsigned int deg) unsigned int syn, syn0; int *rep = (int *)bch->buf; int *root = (int *)bch->buf2; - + k = bch->n - bch->a_log[bch->elp[deg]]; for (i = 0; i < deg; i++) { rep[i] = bch->elp[i] ? mod(bch, bch->a_log[ bch->elp[i] ] + k) : -1;