aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Juan <ted.juan@gmail.com>2014-05-28 10:33:06 -0400
committerBrian Norris <computersforpeace@gmail.com>2014-05-28 16:13:00 -0400
commit2913aae5f9eae2f857cdeff5388bb22d0751aa08 (patch)
tree56c6c88ff9faa848352b9687ef1d8ba9b950a4ba
parentab7f6fcec33a01279d2abeaf1c4ccdfa8a5d93ff (diff)
mtd: nand: omap: fix omap_calculate_ecc_bch() for-loop error
Fixes: 2c9f2365d1e1d0e318b068f683f18c99515b80f8 mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch4 in omap_calculate_ecc_bch Fixes: 7bcd1dca1d587ad29f9825ba4414620440e8c8da mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch8 in omap_calculate_ecc_bch Cc: <stable@vger.kernel.org> # 3.13.x+ Signed-off-by: Ted Juan <ted.juan@gmail.com> Acked-by: Pekon Gupta <pekon@ti.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r--drivers/mtd/nand/omap2.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index cbe87a8e6218..f0ed92e210a1 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1180,7 +1180,7 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,
1180 u8 *ecc_code; 1180 u8 *ecc_code;
1181 unsigned long nsectors, bch_val1, bch_val2, bch_val3, bch_val4; 1181 unsigned long nsectors, bch_val1, bch_val2, bch_val3, bch_val4;
1182 u32 val; 1182 u32 val;
1183 int i; 1183 int i, j;
1184 1184
1185 nsectors = ((readl(info->reg.gpmc_ecc_config) >> 4) & 0x7) + 1; 1185 nsectors = ((readl(info->reg.gpmc_ecc_config) >> 4) & 0x7) + 1;
1186 for (i = 0; i < nsectors; i++) { 1186 for (i = 0; i < nsectors; i++) {
@@ -1263,8 +1263,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,
1263 case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW: 1263 case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW:
1264 /* Add constant polynomial to remainder, so that 1264 /* Add constant polynomial to remainder, so that
1265 * ECC of blank pages results in 0x0 on reading back */ 1265 * ECC of blank pages results in 0x0 on reading back */
1266 for (i = 0; i < eccbytes; i++) 1266 for (j = 0; j < eccbytes; j++)
1267 ecc_calc[i] ^= bch4_polynomial[i]; 1267 ecc_calc[j] ^= bch4_polynomial[j];
1268 break; 1268 break;
1269 case OMAP_ECC_BCH4_CODE_HW: 1269 case OMAP_ECC_BCH4_CODE_HW:
1270 /* Set 8th ECC byte as 0x0 for ROM compatibility */ 1270 /* Set 8th ECC byte as 0x0 for ROM compatibility */
@@ -1273,8 +1273,8 @@ static int __maybe_unused omap_calculate_ecc_bch(struct mtd_info *mtd,
1273 case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW: 1273 case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW:
1274 /* Add constant polynomial to remainder, so that 1274 /* Add constant polynomial to remainder, so that
1275 * ECC of blank pages results in 0x0 on reading back */ 1275 * ECC of blank pages results in 0x0 on reading back */
1276 for (i = 0; i < eccbytes; i++) 1276 for (j = 0; j < eccbytes; j++)
1277 ecc_calc[i] ^= bch8_polynomial[i]; 1277 ecc_calc[j] ^= bch8_polynomial[j];
1278 break; 1278 break;
1279 case OMAP_ECC_BCH8_CODE_HW: 1279 case OMAP_ECC_BCH8_CODE_HW:
1280 /* Set 14th ECC byte as 0x0 for ROM compatibility */ 1280 /* Set 14th ECC byte as 0x0 for ROM compatibility */