mtd: tests: incorporate error message for mtdtest_write()

All callers of mtdtest_write() print the same error message on failure.
This incorporates the error message to mtdtest_write() and removes them
from the callers.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Šī revīzija ir iekļauta:
Akinobu Mita
2013-08-15 22:55:09 +09:00
revīziju iesūtīja David Woodhouse
vecāks abc173ad84
revīzija 8a9f4aa3ac
5 mainīti faili ar 12 papildinājumiem un 50 dzēšanām

Parādīt failu

@@ -80,14 +80,9 @@ static int multiblock_erase(int ebnum, int blocks)
static int write_eraseblock(int ebnum)
{
int err;
loff_t addr = ebnum * mtd->erasesize;
err = mtdtest_write(mtd, addr, mtd->erasesize, iobuf);
if (err)
pr_err("error: write failed at %#llx\n", addr);
return err;
return mtdtest_write(mtd, addr, mtd->erasesize, iobuf);
}
static int write_eraseblock_by_page(int ebnum)
@@ -98,11 +93,8 @@ static int write_eraseblock_by_page(int ebnum)
for (i = 0; i < pgcnt; i++) {
err = mtdtest_write(mtd, addr, pgsize, buf);
if (err) {
pr_err("error: write failed at %#llx\n",
addr);
if (err)
break;
}
addr += pgsize;
buf += pgsize;
}
@@ -119,21 +111,13 @@ static int write_eraseblock_by_2pages(int ebnum)
for (i = 0; i < n; i++) {
err = mtdtest_write(mtd, addr, sz, buf);
if (err) {
pr_err("error: write failed at %#llx\n",
addr);
if (err)
return err;
}
addr += sz;
buf += sz;
}
if (pgcnt % 2) {
if (pgcnt % 2)
err = mtdtest_write(mtd, addr, pgsize, buf);
if (err) {
pr_err("error: write failed at %#llx\n",
addr);
}
}
return err;
}