diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2013-08-15 17:55:08 +0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2013-08-31 00:36:05 +0400 |
commit | abc173ad84e50645f9136ea56afa9f86c98bf349 (patch) | |
tree | ab33103502169514f85a0a5013b015f5c3f1f3c0 /drivers/mtd/tests/speedtest.c | |
parent | 0d58f6ee0106256c47db9640141469d1ed80819a (diff) | |
download | linux-abc173ad84e50645f9136ea56afa9f86c98bf349.tar.xz |
mtd: tests: incorporate error message for mtdtest_read()
All callers of mtdtest_read() print the same error message on failure.
This incorporates the error message to mtdtest_read() 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>
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 457c45c6a704..d1a38530612e 100644 --- a/drivers/mtd/tests/speedtest.c +++ b/drivers/mtd/tests/speedtest.c @@ -140,14 +140,9 @@ static int write_eraseblock_by_2pages(int ebnum) static int read_eraseblock(int ebnum) { - int err; loff_t addr = ebnum * mtd->erasesize; - err = mtdtest_read(mtd, addr, mtd->erasesize, iobuf); - if (err) - pr_err("error: read failed at %#llx\n", addr); - - return err; + return mtdtest_read(mtd, addr, mtd->erasesize, iobuf); } static int read_eraseblock_by_page(int ebnum) @@ -158,11 +153,8 @@ static int read_eraseblock_by_page(int ebnum) for (i = 0; i < pgcnt; i++) { err = mtdtest_read(mtd, addr, pgsize, buf); - if (err) { - pr_err("error: read failed at %#llx\n", - addr); + if (err) break; - } addr += pgsize; buf += pgsize; } @@ -179,21 +171,13 @@ static int read_eraseblock_by_2pages(int ebnum) for (i = 0; i < n; i++) { err = mtdtest_read(mtd, addr, sz, buf); - if (err) { - pr_err("error: read failed at %#llx\n", - addr); + if (err) return err; - } addr += sz; buf += sz; } - if (pgcnt % 2) { + if (pgcnt % 2) err = mtdtest_read(mtd, addr, pgsize, buf); - if (err) { - pr_err("error: read failed at %#llx\n", - addr); - } - } return err; } |