Patchwork mtd: atmel_nand: fix pmecc selction for ecc requirement typo

login
register
mail settings
Submitter Wu, Josh
Date July 3, 2013, 9:56 a.m.
Message ID <1372845379-5958-1-git-send-email-josh.wu@atmel.com>
Download mbox | patch
Permalink /patch/256601/
State Accepted
Commit edc9cba495680a8a4968ed204b5c9f61a991bf4f
Headers show

Comments

Wu, Josh - July 3, 2013, 9:56 a.m.
Atmel PMECC support 2, 4, 8, 12, 24 bit error correction.
So if the ecc requirement in ONFI is <= 2, 4, 8, 12, 24.
We will use 2, 4, 8, 12, 24.

This patch fix the typo. Use '<=' replace '<'.

Reported-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
 drivers/mtd/nand/atmel_nand.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Artem Bityutskiy - Aug. 5, 2013, 10 a.m.
On Wed, 2013-07-03 at 17:56 +0800, Josh Wu wrote:
> Atmel PMECC support 2, 4, 8, 12, 24 bit error correction.
> So if the ecc requirement in ONFI is <= 2, 4, 8, 12, 24.
> We will use 2, 4, 8, 12, 24.
> 
> This patch fix the typo. Use '<=' replace '<'.
> 
> Reported-by: Scott Wood <scottwood@freescale.com>
> Signed-off-by: Josh Wu <josh.wu@atmel.com>

Pushed to l2-mtd.git, thanks!

Patch

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 7e50ed8..2a42aa8 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -960,11 +960,11 @@  static int pmecc_choose_ecc(struct atmel_nand_host *host,
 			host->pmecc_corr_cap = 2;
 		else if (*cap <= 4)
 			host->pmecc_corr_cap = 4;
-		else if (*cap < 8)
+		else if (*cap <= 8)
 			host->pmecc_corr_cap = 8;
-		else if (*cap < 12)
+		else if (*cap <= 12)
 			host->pmecc_corr_cap = 12;
-		else if (*cap < 24)
+		else if (*cap <= 24)
 			host->pmecc_corr_cap = 24;
 		else
 			return -EINVAL;