public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@logfs.org>
To: Matt Reimer <mattjreimer@gmail.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] MTD: make s3c2410's correct_data indicate an error for multi-bit read errors
Date: Fri, 19 Oct 2007 10:24:38 +0200	[thread overview]
Message-ID: <20071019082438.GA26913@lazybastard.org> (raw)
In-Reply-To: <f383264b0710181813i61b5b9acs76afdf27f199adcc@mail.gmail.com>

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@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

  reply	other threads:[~2007-10-19  8:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-19  1:13 [PATCH] MTD: make s3c2410's correct_data indicate an error for multi-bit read errors Matt Reimer
2007-10-19  8:24 ` Jörn Engel [this message]
2007-10-19  9:00   ` Artem Bityutskiy
2007-10-19 19:29     ` Matt Reimer
2007-10-20 10:28       ` Jörn Engel
  -- strict thread matches above, loose matches on Subject: below --
2007-10-20 16:48 Matt Reimer
2007-10-25 18:12 ` Matt Reimer
2007-10-20 16:44 Matt Reimer
2007-10-20 16:49 ` Matt Reimer
2007-10-19  1:02 [PATCH] MTD: fix s3c2410 error correction Matt Reimer
2007-10-19  1:02 ` [PATCH] MTD: make s3c2410's correct_data indicate an error for multi-bit read errors Matt Reimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071019082438.GA26913@lazybastard.org \
    --to=joern@logfs.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mattjreimer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox