Comments
Patch
@@ -313,21 +313,18 @@ static int __init tort_init(void)
int i;
void *patt;
- /* Erase all eraseblocks */
for (i = eb; i < eb + ebcnt; i++) {
if (bad_ebs[i - eb])
continue;
+
+ /* Erase all eraseblocks */
err = erase_eraseblock(i);
if (err)
goto out;
cond_resched();
- }
- /* Check if the eraseblocks contain only 0xFF bytes */
- if (check) {
- for (i = eb; i < eb + ebcnt; i++) {
- if (bad_ebs[i - eb])
- continue;
+ /* Check if the eraseblocks contain only 0xFF bytes */
+ if (check) {
err = check_eraseblock(i, patt_FF);
if (err) {
pr_info("verify failed"
@@ -336,12 +333,8 @@ static int __init tort_init(void)
}
cond_resched();
}
- }
- /* Write the pattern */
- for (i = eb; i < eb + ebcnt; i++) {
- if (bad_ebs[i - eb])
- continue;
+ /* Write the pattern */
if ((eb + erase_cycles) & 1)
patt = patt_5A5;
else
@@ -350,17 +343,9 @@ static int __init tort_init(void)
if (err)
goto out;
cond_resched();
- }
- /* Verify what we wrote */
- if (check) {
- for (i = eb; i < eb + ebcnt; i++) {
- if (bad_ebs[i - eb])
- continue;
- if ((eb + erase_cycles) & 1)
- patt = patt_5A5;
- else
- patt = patt_A5A;
+ /* Verify what we wrote */
+ if (check) {
err = check_eraseblock(i, patt);
if (err) {
pr_info("verify failed for %s"
Rewrite the torture cycle, do the erase-write-verify process in one block unit, not in several blocks unit. This patch makes preparations for adding the rand data pattern support. Signed-off-by: Huang Shijie <b32955@freescale.com> --- drivers/mtd/tests/mtd_torturetest.c | 29 +++++++---------------------- 1 files changed, 7 insertions(+), 22 deletions(-)