mtd: nand: use the nand_read_subpage index everywhere

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jun 10 23:59:02 PDT 2014


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=47570bb1f533b2a48e5222db8545b7842c229331
Commit:     47570bb1f533b2a48e5222db8545b7842c229331
Parent:     9fd6c6c18c1a4a3220473c76fd447c5708b5ecf9
Author:     Ron <ron at debian.org>
AuthorDate: Sun Mar 16 04:01:08 2014 +1030
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Tue Apr 15 23:25:36 2014 -0700

    mtd: nand: use the nand_read_subpage index everywhere
    
    Now that the index variable is correctly set earlier in this function
    we can use it in other places that compute the same thing too.
    
    Signed-off-by: Ron Lee <ron at debian.org>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/nand_base.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 9d01c4d..b8eabde 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1204,8 +1204,7 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
 	 * ecc.pos. Let's make sure that there are no gaps in ECC positions.
 	 */
 	for (i = 0; i < eccfrag_len - 1; i++) {
-		if (eccpos[i + start_step * chip->ecc.bytes] + 1 !=
-			eccpos[i + start_step * chip->ecc.bytes + 1]) {
+		if (eccpos[i + index] + 1 != eccpos[i + index + 1]) {
 			gaps = 1;
 			break;
 		}



More information about the linux-mtd-cvs mailing list