After a page read, the old failure statistics are compared against the
new failure statistics before the new values are actually read.
Signed-off-by: Harpreet "Eli" Sangha <harpreet@nestlabs.com>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
return -1;
}
+ if (ioctl(fd, ECCGETSTATS, &new) != 0)
+ goto failstats;
+
if (new.failed > old.failed) {
fprintf(stderr, "Failed to recover %d bitflips\n",
new.failed - old.failed);
return -1;
}
- if (ioctl(fd, ECCGETSTATS, &new) != 0)
- goto failstats;
-
return new.corrected - old.corrected;
failstats:
perror("ECCGETSTATS");