[PATCH 7/7] mtd: driver _read() returns max_bitflips; mtd_read() returns -EUCLEAN

Robert Jarzmik robert.jarzmik at free.fr
Wed Apr 25 14:27:18 EDT 2012


Mike Dunn <mikedunn at newsguy.com> writes:

One little trick with docg3 patch part:
> diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
> index 3414031..7644d59 100644
> --- a/drivers/mtd/devices/docg3.c
> +++ b/drivers/mtd/devices/docg3.c
> @@ -948,7 +949,8 @@ static int doc_read_oob(struct mtd_info *mtd, loff_t from,
>  			}
>  			if (ret > 0) {
>  				mtd->ecc_stats.corrected += ret;
> -				ret = -EUCLEAN;
> +				max_bitflips = max(max_bitflips, ret);
> +				ret = max_bitflips;
>  			}
>  		}

If you do set ret here, the next loop you'll do in the following statement
"	while (!ret && (len > 0 || ooblen > 0)) {" will exit because ret is not
0.

I think you should change :
>- 	while (!ret && (len > 0 || ooblen > 0)) {" will exit because ret is not
into
>- 	while (ret >= 0 && (len > 0 || ooblen > 0)) {".

With that change, please add my:
Acked-by: Robert Jarzmik <robert.jarzmik at free.fr>

Cheers.

-- 
Robert

PS: It's really a great work that bitflip serie



More information about the linux-mtd mailing list