mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 14:10:49 +07:00
mtd: tests: nandbiterrs: Fix read_page return value
The number of corrected bitflips is not correctly reported by the test until the bitflip threshold is reached. read_page() shall return the number of corrected bitflips, but mtd_read() returns 0 or a negative error, so we can't forward its return value. In the absence of an error we always have calculate the number of bitflips ourselves. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
This commit is contained in:
parent
f953f0f896
commit
6cbefbdcec
@ -151,7 +151,7 @@ static int read_page(int log)
|
||||
memcpy(&oldstats, &mtd->ecc_stats, sizeof(oldstats));
|
||||
|
||||
err = mtd_read(mtd, offset, mtd->writesize, &read, rbuffer);
|
||||
if (err == -EUCLEAN)
|
||||
if (!err || err == -EUCLEAN)
|
||||
err = mtd->ecc_stats.corrected - oldstats.corrected;
|
||||
|
||||
if (err < 0 || read != mtd->writesize) {
|
||||
|
Loading…
Reference in New Issue
Block a user