Skip to content

Commit aac931a

Browse files
committed
modify astyle
1 parent f616b7f commit aac931a

File tree

1 file changed

+12
-12
lines changed
  • storage/blockdevice/COMPONENT_SPINAND/source

1 file changed

+12
-12
lines changed

storage/blockdevice/COMPONENT_SPINAND/source/bch.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static void encode_bch_unaligned(struct bch_control *bch,
150150
p = bch->mod8_tab + (l + 1) * (((ecc[0] >> 24) ^ (*data++)) & 0xff);
151151

152152
for (i = 0; i < l; i++) {
153-
ecc[i] = ((ecc[i] << 8) | (ecc[i+1] >> 24)) ^ (*p++);
153+
ecc[i] = ((ecc[i] << 8) | (ecc[i + 1] >> 24)) ^ (*p++);
154154
}
155155

156156
ecc[l] = (ecc[l] << 8) ^ (*p);
@@ -267,19 +267,19 @@ void encode_bch(struct bch_control *bch, const uint8_t *data,
267267

268268
for (i = 0; i < l; i++) {
269269
r[i] = r[i + 1] ^ p0[i] ^ p1[i] ^ p2[i] ^ p3[i];
270+
r[l] = p0[l] ^ p1[l] ^ p2[l] ^ p3[l];
271+
}
272+
memcpy(bch->ecc_buf, r, sizeof(r));
270273

271-
r[l] = p0[l] ^ p1[l] ^ p2[l] ^ p3[l];
272-
}
273-
memcpy(bch->ecc_buf, r, sizeof(r));
274-
275-
/* process last unaligned bytes */
276-
if (len) {
277-
encode_bch_unaligned(bch, data, len, bch->ecc_buf);
278-
}
274+
/* process last unaligned bytes */
275+
if (len) {
276+
encode_bch_unaligned(bch, data, len, bch->ecc_buf);
277+
}
279278

280-
/* store ecc parity bytes into original parity buffer */
281-
if (ecc) {
282-
store_ecc8(bch, ecc, bch->ecc_buf);
279+
/* store ecc parity bytes into original parity buffer */
280+
if (ecc) {
281+
store_ecc8(bch, ecc, bch->ecc_buf);
282+
}
283283
}
284284
}
285285

0 commit comments

Comments
 (0)