diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2010-07-13 06:24:31 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-08-02 04:06:20 -0400 |
commit | 7fc14bcee0fc0fe1b7e1bd78d4fc0da395ebef35 (patch) | |
tree | f73d13b6c3f68423d04d1e0373c8d318c5cd38a0 /drivers/mtd/tests | |
parent | ece0ac98a13a555e6d46a02225fa15934abe7a3d (diff) |
mtd: tests: return -1 if verify failed
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/tests')
-rw-r--r-- | drivers/mtd/tests/mtd_pagetest.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/mtd/tests/mtd_pagetest.c b/drivers/mtd/tests/mtd_pagetest.c index 6bc1b8276c62..00b937e38c1d 100644 --- a/drivers/mtd/tests/mtd_pagetest.c +++ b/drivers/mtd/tests/mtd_pagetest.c | |||
@@ -310,7 +310,7 @@ static int crosstest(void) | |||
310 | static int erasecrosstest(void) | 310 | static int erasecrosstest(void) |
311 | { | 311 | { |
312 | size_t read = 0, written = 0; | 312 | size_t read = 0, written = 0; |
313 | int err = 0, i, ebnum, ok = 1, ebnum2; | 313 | int err = 0, i, ebnum, ebnum2; |
314 | loff_t addr0; | 314 | loff_t addr0; |
315 | char *readbuf = twopages; | 315 | char *readbuf = twopages; |
316 | 316 | ||
@@ -357,8 +357,7 @@ static int erasecrosstest(void) | |||
357 | if (memcmp(writebuf, readbuf, pgsize)) { | 357 | if (memcmp(writebuf, readbuf, pgsize)) { |
358 | printk(PRINT_PREF "verify failed!\n"); | 358 | printk(PRINT_PREF "verify failed!\n"); |
359 | errcnt += 1; | 359 | errcnt += 1; |
360 | ok = 0; | 360 | return -1; |
361 | return err; | ||
362 | } | 361 | } |
363 | 362 | ||
364 | printk(PRINT_PREF "erasing block %d\n", ebnum); | 363 | printk(PRINT_PREF "erasing block %d\n", ebnum); |
@@ -396,10 +395,10 @@ static int erasecrosstest(void) | |||
396 | if (memcmp(writebuf, readbuf, pgsize)) { | 395 | if (memcmp(writebuf, readbuf, pgsize)) { |
397 | printk(PRINT_PREF "verify failed!\n"); | 396 | printk(PRINT_PREF "verify failed!\n"); |
398 | errcnt += 1; | 397 | errcnt += 1; |
399 | ok = 0; | 398 | return -1; |
400 | } | 399 | } |
401 | 400 | ||
402 | if (ok && !err) | 401 | if (!err) |
403 | printk(PRINT_PREF "erasecrosstest ok\n"); | 402 | printk(PRINT_PREF "erasecrosstest ok\n"); |
404 | return err; | 403 | return err; |
405 | } | 404 | } |