[PATCH] MTD: make s3c2410's correct_data indicate an error for multi-bit read errors

Jörn Engel joern at logfs.org
Fri Oct 19 04:24:38 EDT 2007


On Thu, 18 October 2007 18:13:07 -0700, Matt Reimer wrote:
> 
> If there were multiple bit errors in the data s3c2410_nand_correct_data()
> was returning 0 (no error) instead of -1, so the upper layers (like JFFS2)
> would not know the data is corrupt.
> 
> Signed-off-by: Matt Reimer <mreimer at vpop.net>
> ---
>  drivers/mtd/nand/s3c2410.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
> index 077fdcc..2e6b435 100644
> --- a/drivers/mtd/nand/s3c2410.c
> +++ b/drivers/mtd/nand/s3c2410.c
> @@ -397,7 +397,7 @@ static int s3c2410_nand_correct_data(struct
> mtd_info *mtd, u_char *dat,
>         if ((diff0 & ~(1<<fls(diff0))) == 0)
>                 return 1;
> 
> -       return 0;
> +       return -1;
>  }

Why don't you return -EBADMSG?

Jörn

-- 
I can say that I spend most of my time fixing bugs even if I have lots
of new features to implement in mind, but I give bugs more priority.
-- Andrea Arcangeli, 2000



More information about the linux-mtd mailing list