提交 7fc14bce 编写于 作者: R Roel Kluin 提交者: David Woodhouse

mtd: tests: return -1 if verify failed

Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 ece0ac98
......@@ -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;
......@@ -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);
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册