mirror of
https://xff.cz/git/u-boot/
synced 2025-09-04 02:02:08 +02:00
cmd: mem: Correctly count the errors in mtest
This patch changes mtest to correctly count the overall errors and print them even in the abort (Ctrl-C) case. Signed-off-by: Stefan Roese <sr@denx.de>
This commit is contained in:
11
cmd/mem.c
11
cmd/mem.c
@@ -871,7 +871,7 @@ static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
|
|||||||
ulong start, end;
|
ulong start, end;
|
||||||
vu_long *buf, *dummy;
|
vu_long *buf, *dummy;
|
||||||
ulong iteration_limit = 0;
|
ulong iteration_limit = 0;
|
||||||
int ret;
|
ulong count = 0;
|
||||||
ulong errs = 0; /* number of errors, or -1 if interrupted */
|
ulong errs = 0; /* number of errors, or -1 if interrupted */
|
||||||
ulong pattern = 0;
|
ulong pattern = 0;
|
||||||
int iteration;
|
int iteration;
|
||||||
@@ -929,6 +929,7 @@ static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
|
|||||||
}
|
}
|
||||||
if (errs == -1UL)
|
if (errs == -1UL)
|
||||||
break;
|
break;
|
||||||
|
count += errs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -947,14 +948,10 @@ static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
|
|||||||
if (errs == -1UL) {
|
if (errs == -1UL) {
|
||||||
/* Memory test was aborted - write a newline to finish off */
|
/* Memory test was aborted - write a newline to finish off */
|
||||||
putc('\n');
|
putc('\n');
|
||||||
ret = 1;
|
|
||||||
} else {
|
|
||||||
printf("Tested %d iteration(s) with %lu errors.\n",
|
|
||||||
iteration, errs);
|
|
||||||
ret = errs != 0;
|
|
||||||
}
|
}
|
||||||
|
printf("Tested %d iteration(s) with %lu errors.\n", iteration, count);
|
||||||
|
|
||||||
return ret;
|
return errs != 0;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_CMD_MEMTEST */
|
#endif /* CONFIG_CMD_MEMTEST */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user