Patchwork [2/4] drivers/mtd/tests/mtd_pagetest.c: return -1 if verify failed

login
register
mail settings
Submitter Andrew Morton
Date July 20, 2010, 10:24 p.m.
Message ID <201007202224.o6KMO0ck021384@imap1.linux-foundation.org>
Download mbox | patch
Permalink /patch/59382/
State New
Headers show

Comments

Andrew Morton - July 20, 2010, 10:24 p.m.
From: Roel Kluin <roel.kluin@gmail.com>

It should return -1 if the verify failed.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Anton Vorontsov <cbou@mail.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/mtd/tests/mtd_pagetest.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Artem Bityutskiy - July 21, 2010, 10:35 a.m.
On Tue, 2010-07-20 at 15:24 -0700, akpm@linux-foundation.org wrote:
> From: Roel Kluin <roel.kluin@gmail.com>
> 
> It should return -1 if the verify failed.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: Anton Vorontsov <cbou@mail.ru>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

This patch, but in an improved form, is also in my l2-mtd-2.6.git /
master tree.

Patch

diff -puN drivers/mtd/tests/mtd_pagetest.c~mtd-return-1-if-verify-failed drivers/mtd/tests/mtd_pagetest.c
--- a/drivers/mtd/tests/mtd_pagetest.c~mtd-return-1-if-verify-failed
+++ a/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);