linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: omap: fix omap_calculate_ecc_bch() for-loop error
@ 2014-05-22  9:56 ted.juan
  0 siblings, 0 replies; 12+ messages in thread
From: ted.juan @ 2014-05-22  9:56 UTC (permalink / raw)
  To: computersforpeace; +Cc: ted.juan, linux-mtd, pekon

From: "ted.juan" <ted.juan@gmail.com>


I am sorry that I didn't use the git-send-mail last time.


Signed-off-by: ted.juan <ted.juan@gmail.com>
---
 drivers/mtd/nand/omap2.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 1ff49b8..e21145a 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1162,7 +1162,7 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,
 	struct gpmc_nand_regs	*gpmc_regs = &info->reg;
 	u8 *ecc_code;
 	unsigned long nsectors, bch_val1, bch_val2, bch_val3, bch_val4;
-	int i;
+	int i, j;
 
 	nsectors = ((readl(info->reg.gpmc_ecc_config) >> 4) & 0x7) + 1;
 	for (i = 0; i < nsectors; i++) {
@@ -1210,8 +1210,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,
 		case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW:
 			/* Add constant polynomial to remainder, so that
 			 * ECC of blank pages results in 0x0 on reading back */
-			for (i = 0; i < eccbytes; i++)
-				ecc_calc[i] ^= bch4_polynomial[i];
+			for (j = 0; j < eccbytes; j++)
+				ecc_calc[j] ^= bch4_polynomial[j];
 			break;
 		case OMAP_ECC_BCH4_CODE_HW:
 			/* Set  8th ECC byte as 0x0 for ROM compatibility */
@@ -1220,8 +1220,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,
 		case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW:
 			/* Add constant polynomial to remainder, so that
 			 * ECC of blank pages results in 0x0 on reading back */
-			for (i = 0; i < eccbytes; i++)
-				ecc_calc[i] ^= bch8_polynomial[i];
+			for (j = 0; j < eccbytes; j++)
+				ecc_calc[j] ^= bch8_polynomial[j];
 			break;
 		case OMAP_ECC_BCH8_CODE_HW:
 			/* Set 14th ECC byte as 0x0 for ROM compatibility */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread
* [PATCH] mtd: nand: omap: fix omap_calculate_ecc_bch() for-loop error
@ 2014-05-16  9:38 Ted Juan
  2014-05-16  9:50 ` Gupta, Pekon
  2014-05-21 23:36 ` Brian Norris
  0 siblings, 2 replies; 12+ messages in thread
From: Ted Juan @ 2014-05-16  9:38 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org, Gupta, Pekon

The patch is mirror issue that the for-loop use the same variable.


Signed-off-by: ted.juan <ted.juan@gmail.com>
---
 drivers/mtd/nand/omap2.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 1ff49b8..e21145a 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1162,7 +1162,7 @@ static int __maybe_unused
omap_calculate_ecc_bch(struct mtd_info *mtd,
        struct gpmc_nand_regs   *gpmc_regs = &info->reg;
        u8 *ecc_code;
        unsigned long nsectors, bch_val1, bch_val2, bch_val3, bch_val4;
-       int i;
+       int i, j;

        nsectors = ((readl(info->reg.gpmc_ecc_config) >> 4) & 0x7) + 1;
        for (i = 0; i < nsectors; i++) {
@@ -1210,8 +1210,8 @@ static int __maybe_unused
omap_calculate_ecc_bch(struct mtd_info *mtd,
                case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW:
                        /* Add constant polynomial to remainder, so that
                         * ECC of blank pages results in 0x0 on reading back */
-                       for (i = 0; i < eccbytes; i++)
-                               ecc_calc[i] ^= bch4_polynomial[i];
+                       for (j = 0; j < eccbytes; j++)
+                               ecc_calc[j] ^= bch4_polynomial[j];
                        break;
                case OMAP_ECC_BCH4_CODE_HW:
                        /* Set  8th ECC byte as 0x0 for ROM compatibility */
@@ -1220,8 +1220,8 @@ static int __maybe_unused
omap_calculate_ecc_bch(struct mtd_info *mtd,
                case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW:
                        /* Add constant polynomial to remainder, so that
                         * ECC of blank pages results in 0x0 on reading back */
-                       for (i = 0; i < eccbytes; i++)
-                               ecc_calc[i] ^= bch8_polynomial[i];
+                       for (j = 0; j < eccbytes; j++)
+                               ecc_calc[j] ^= bch8_polynomial[j];
                        break;
                case OMAP_ECC_BCH8_CODE_HW:
                        /* Set 14th ECC byte as 0x0 for ROM compatibility */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-05-28 20:18 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20980858CB6D3A4BAE95CA194937D5E73EAD825F@DBDE04.ent.ti.com>
2014-05-23  2:54 ` [PATCH] mtd: nand: omap: fix omap_calculate_ecc_bch() for-loop error ted.juan
2014-05-23  3:24   ` ted.juan
2014-05-28  9:09     ` Brian Norris
2014-05-28 14:33       ` Ted Juan
2014-05-28 20:18         ` Brian Norris
2014-05-23  4:05   ` Ted Juan
2014-05-27  6:16     ` Gupta, Pekon
2014-05-28  0:46       ` Ted Juan
2014-05-22  9:56 ted.juan
  -- strict thread matches above, loose matches on Subject: below --
2014-05-16  9:38 Ted Juan
2014-05-16  9:50 ` Gupta, Pekon
2014-05-21 23:36 ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).