Patchwork mtd: return -1 if verify failed

login
register
mail settings
Submitter roel kluin
Date July 1, 2010, 10:12 p.m.
Message ID <4C2D12C1.3000801@gmail.com>
Download mbox | patch
Permalink /patch/57593/
State New
Headers show

Comments

roel kluin - July 1, 2010, 10:12 p.m.
It should return -1 if the verify failed.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
I think this needed, correct?
Artem Bityutskiy - July 13, 2010, 10:24 a.m.
On Fri, 2010-07-02 at 00:12 +0200, Roel Kluin wrote:
> It should return -1 if the verify failed.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> I think this needed, correct?
> 
> diff --git a/drivers/mtd/tests/mtd_pagetest.c b/drivers/mtd/tests/mtd_pagetest.c
> index 6bc1b82..7414888 100644
> --- a/drivers/mtd/tests/mtd_pagetest.c
> +++ b/drivers/mtd/tests/mtd_pagetest.c
> @@ -358,7 +358,7 @@ static int erasecrosstest(void)
>  		printk(PRINT_PREF "verify failed!\n");
>  		errcnt += 1;
>  		ok = 0;
> -		return err;
> +		return -1;
>  	}

Yeah, I changed your patch a bit and removed the 'ok' variable
altogether. Pushed to l2-mtd-2.6.git, please, check:

http://git.infradead.org/users/dedekind/l2-mtd-2.6.git/commit/4e2ef8529d9bc2e2b96f18a1a2917bda5475f0e4

Patch

diff --git a/drivers/mtd/tests/mtd_pagetest.c b/drivers/mtd/tests/mtd_pagetest.c
index 6bc1b82..7414888 100644
--- a/drivers/mtd/tests/mtd_pagetest.c
+++ b/drivers/mtd/tests/mtd_pagetest.c
@@ -358,7 +358,7 @@  static int erasecrosstest(void)
 		printk(PRINT_PREF "verify failed!\n");
 		errcnt += 1;
 		ok = 0;
-		return err;
+		return -1;
 	}
 
 	printk(PRINT_PREF "erasing block %d\n", ebnum);