Skip to content

Commit 1617942

Browse files
committed
mtd: rawnand: marvell: Rename the ->correct() function
There is no correction involved at this point, it is just a matter of reading registers and checking whether bitflips have occurred or not. Rename the function to clarify it. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Link: https://lore.kernel.org/linux-mtd/20200424164501.26719-7-miquel.raynal@bootlin.com
1 parent 82c6c04 commit 1617942

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

‎drivers/mtd/nand/raw/marvell_nand.c‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -932,14 +932,14 @@ static void marvell_nfc_check_empty_chunk(struct nand_chip *chip,
932932
}
933933

934934
/*
935-
* Check a chunk is correct or not according to hardware ECC engine.
935+
* Check if a chunk is correct or not according to the hardware ECC engine.
936936
* mtd->ecc_stats.corrected is updated, as well as max_bitflips, however
937937
* mtd->ecc_stats.failure is not, the function will instead return a non-zero
938938
* value indicating that a check on the emptyness of the subpage must be
939-
* performed before declaring the subpage corrupted.
939+
* performed before actually declaring the subpage as "corrupted".
940940
*/
941-
static int marvell_nfc_hw_ecc_correct(struct nand_chip *chip,
942-
unsigned int *max_bitflips)
941+
static int marvell_nfc_hw_ecc_check_bitflips(struct nand_chip *chip,
942+
unsigned int *max_bitflips)
943943
{
944944
struct mtd_info *mtd = nand_to_mtd(chip);
945945
struct marvell_nfc *nfc = to_marvell_nfc(chip->controller);
@@ -1053,7 +1053,7 @@ static int marvell_nfc_hw_ecc_hmg_read_page(struct nand_chip *chip, u8 *buf,
10531053
marvell_nfc_enable_hw_ecc(chip);
10541054
marvell_nfc_hw_ecc_hmg_do_read_page(chip, buf, chip->oob_poi, false,
10551055
page);
1056-
ret = marvell_nfc_hw_ecc_correct(chip, &max_bitflips);
1056+
ret = marvell_nfc_hw_ecc_check_bitflips(chip, &max_bitflips);
10571057
marvell_nfc_disable_hw_ecc(chip);
10581058

10591059
if (!ret)
@@ -1336,7 +1336,7 @@ static int marvell_nfc_hw_ecc_bch_read_page(struct nand_chip *chip,
13361336
/* Read the chunk and detect number of bitflips */
13371337
marvell_nfc_hw_ecc_bch_read_chunk(chip, chunk, data, data_len,
13381338
spare, spare_len, page);
1339-
ret = marvell_nfc_hw_ecc_correct(chip, &max_bitflips);
1339+
ret = marvell_nfc_hw_ecc_check_bitflips(chip, &max_bitflips);
13401340
if (ret)
13411341
failure_mask |= BIT(chunk);
13421342

@@ -1358,10 +1358,9 @@ static int marvell_nfc_hw_ecc_bch_read_page(struct nand_chip *chip,
13581358
*/
13591359

13601360
/*
1361-
* In case there is any subpage read error reported by ->correct(), we
1362-
* usually re-read only ECC bytes in raw mode and check if the whole
1363-
* page is empty. In this case, it is normal that the ECC check failed
1364-
* and we just ignore the error.
1361+
* In case there is any subpage read error, we usually re-read only ECC
1362+
* bytes in raw mode and check if the whole page is empty. In this case,
1363+
* it is normal that the ECC check failed and we just ignore the error.
13651364
*
13661365
* However, it has been empirically observed that for some layouts (e.g
13671366
* 2k page, 8b strength per 512B chunk), the controller tries to correct

0 commit comments

Comments
 (0)