diff options
Diffstat (limited to 'drivers/mtd/tests/speedtest.c')
-rw-r--r-- | drivers/mtd/tests/speedtest.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/drivers/mtd/tests/speedtest.c b/drivers/mtd/tests/speedtest.c index d1a38530612e..87ff6a29f84e 100644 --- a/drivers/mtd/tests/speedtest.c +++ b/drivers/mtd/tests/speedtest.c @@ -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; } |