Skip to content

Commit

Permalink
mtd: tests: return -1 if verify failed
Browse files Browse the repository at this point in the history
Signed-off-by: Roel Kluin <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
  • Loading branch information
RoelKluin authored and David Woodhouse committed Aug 2, 2010
1 parent ece0ac9 commit 7fc14bc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/mtd/tests/mtd_pagetest.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ static int crosstest(void)
static int erasecrosstest(void)
{
size_t read = 0, written = 0;
int err = 0, i, ebnum, ok = 1, ebnum2;
int err = 0, i, ebnum, ebnum2;
loff_t addr0;
char *readbuf = twopages;

Expand Down Expand Up @@ -357,8 +357,7 @@ static int erasecrosstest(void)
if (memcmp(writebuf, readbuf, pgsize)) {
printk(PRINT_PREF "verify failed!\n");
errcnt += 1;
ok = 0;
return err;
return -1;
}

printk(PRINT_PREF "erasing block %d\n", ebnum);
Expand Down Expand Up @@ -396,10 +395,10 @@ static int erasecrosstest(void)
if (memcmp(writebuf, readbuf, pgsize)) {
printk(PRINT_PREF "verify failed!\n");
errcnt += 1;
ok = 0;
return -1;
}

if (ok && !err)
if (!err)
printk(PRINT_PREF "erasecrosstest ok\n");
return err;
}
Expand Down

0 comments on commit 7fc14bc

Please sign in to comment.