mtd: nand: use the nand_read_subpage index everywhere
authorRon <ron@debian.org>
Sat, 15 Mar 2014 17:31:08 +0000 (04:01 +1030)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 16 Apr 2014 06:25:36 +0000 (23:25 -0700)
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@debian.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/nand_base.c

index 9d01c4df838c91000dda6793ae231b0dd0992062..b8eabde8dbdc0e02128b268ae5d2ccbd7eb7d0b3 100644 (file)
@@ -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;
                }