Commit 7fc14bce authored by Roel Kluin's avatar Roel Kluin Committed by David Woodhouse

mtd: tests: return -1 if verify failed

Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent ece0ac98
...@@ -310,7 +310,7 @@ static int crosstest(void) ...@@ -310,7 +310,7 @@ static int crosstest(void)
static int erasecrosstest(void) static int erasecrosstest(void)
{ {
size_t read = 0, written = 0; size_t read = 0, written = 0;
int err = 0, i, ebnum, ok = 1, ebnum2; int err = 0, i, ebnum, ebnum2;
loff_t addr0; loff_t addr0;
char *readbuf = twopages; char *readbuf = twopages;
...@@ -357,8 +357,7 @@ static int erasecrosstest(void) ...@@ -357,8 +357,7 @@ static int erasecrosstest(void)
if (memcmp(writebuf, readbuf, pgsize)) { if (memcmp(writebuf, readbuf, pgsize)) {
printk(PRINT_PREF "verify failed!\n"); printk(PRINT_PREF "verify failed!\n");
errcnt += 1; errcnt += 1;
ok = 0; return -1;
return err;
} }
printk(PRINT_PREF "erasing block %d\n", ebnum); printk(PRINT_PREF "erasing block %d\n", ebnum);
...@@ -396,10 +395,10 @@ static int erasecrosstest(void) ...@@ -396,10 +395,10 @@ static int erasecrosstest(void)
if (memcmp(writebuf, readbuf, pgsize)) { if (memcmp(writebuf, readbuf, pgsize)) {
printk(PRINT_PREF "verify failed!\n"); printk(PRINT_PREF "verify failed!\n");
errcnt += 1; errcnt += 1;
ok = 0; return -1;
} }
if (ok && !err) if (!err)
printk(PRINT_PREF "erasecrosstest ok\n"); printk(PRINT_PREF "erasecrosstest ok\n");
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment