Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Roel Kluin and committed by
David Woodhouse
7fc14bce ece0ac98

+4 -5
+4 -5
drivers/mtd/tests/mtd_pagetest.c
··· 310 310 static int erasecrosstest(void) 311 311 { 312 312 size_t read = 0, written = 0; 313 - int err = 0, i, ebnum, ok = 1, ebnum2; 313 + int err = 0, i, ebnum, ebnum2; 314 314 loff_t addr0; 315 315 char *readbuf = twopages; 316 316 ··· 357 357 if (memcmp(writebuf, readbuf, pgsize)) { 358 358 printk(PRINT_PREF "verify failed!\n"); 359 359 errcnt += 1; 360 - ok = 0; 361 - return err; 360 + return -1; 362 361 } 363 362 364 363 printk(PRINT_PREF "erasing block %d\n", ebnum); ··· 395 396 if (memcmp(writebuf, readbuf, pgsize)) { 396 397 printk(PRINT_PREF "verify failed!\n"); 397 398 errcnt += 1; 398 - ok = 0; 399 + return -1; 399 400 } 400 401 401 - if (ok && !err) 402 + if (!err) 402 403 printk(PRINT_PREF "erasecrosstest ok\n"); 403 404 return err; 404 405 }