From: Brian Norris Date: Tue, 28 Jun 2011 23:28:59 +0000 (-0700) Subject: mtd: tests: ignore corrected bitflips in OOB on mtd_readtest X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=003bc47922047e21ebfb19cb99317273b313f79d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mtd: tests: ignore corrected bitflips in OOB on mtd_readtest read_oob may now return ECC error codes. If the code is -EUCLEAN, then we can safely ignore the error as a corrected bitflip. Signed-off-by: Brian Norris Signed-off-by: Artem Bityutskiy --- diff --git a/drivers/mtd/tests/mtd_readtest.c b/drivers/mtd/tests/mtd_readtest.c index afe71aa15c4b..836792d1d60e 100644 --- a/drivers/mtd/tests/mtd_readtest.c +++ b/drivers/mtd/tests/mtd_readtest.c @@ -75,7 +75,8 @@ static int read_eraseblock_by_page(int ebnum) ops.datbuf = NULL; ops.oobbuf = oobbuf; ret = mtd->read_oob(mtd, addr, &ops); - if (ret || ops.oobretlen != mtd->oobsize) { + if ((ret && ret != -EUCLEAN) || + ops.oobretlen != mtd->oobsize) { printk(PRINT_PREF "error: read oob failed at " "%#llx\n", (long long)addr); if (!err)