mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-04-01 03:51:31 +00:00
omap-gpmc: use SECTOR_BYTES instead of hardcoded value
Replace hardcoded value with defined constant SECTOR_BYTES. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
506c66ee9c
commit
6fe7fe12cc
1 changed files with 4 additions and 4 deletions
|
@ -656,14 +656,14 @@ static int omap_correct_data_bch_sw(struct mtd_info *mtd, u_char *data,
|
||||||
struct nand_chip *chip = mtd_to_nand(mtd);
|
struct nand_chip *chip = mtd_to_nand(mtd);
|
||||||
struct omap_nand_info *info = nand_get_controller_data(chip);
|
struct omap_nand_info *info = nand_get_controller_data(chip);
|
||||||
|
|
||||||
count = decode_bch(info->control, NULL, 512, read_ecc, calc_ecc,
|
count = decode_bch(info->control, NULL, SECTOR_BYTES,
|
||||||
NULL, errloc);
|
read_ecc, calc_ecc, NULL, errloc);
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
/* correct errors */
|
/* correct errors */
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
/* correct data only, not ecc bytes */
|
/* correct data only, not ecc bytes */
|
||||||
if (errloc[i] < 8*512)
|
if (errloc[i] < SECTOR_BYTES << 3)
|
||||||
data[errloc[i]/8] ^= 1 << (errloc[i] & 7);
|
data[errloc[i] >> 3] ^= 1 << (errloc[i] & 7);
|
||||||
debug("corrected bitflip %u\n", errloc[i]);
|
debug("corrected bitflip %u\n", errloc[i]);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
puts("read_ecc: ");
|
puts("read_ecc: ");
|
||||||
|
|
Loading…
Add table
Reference in a new issue