summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2013-02-19 21:56:34 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-02-20 08:23:30 +0100
commit6b005a6098124806d856031666ab09566e7908c9 (patch)
tree6fd5e4a568b1f047b39b54d7794fdd3739edbaa1 /commands
parent9d8a20592fdc55be56add1639606b65e3cc523d1 (diff)
downloadbarebox-6b005a6098124806d856031666ab09566e7908c9.tar.gz
barebox-6b005a6098124806d856031666ab09566e7908c9.tar.xz
nandtest: fix length calculation
Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/nandtest.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/commands/nandtest.c b/commands/nandtest.c
index 4e6024b0c5..ba15ecfb33 100644
--- a/commands/nandtest.c
+++ b/commands/nandtest.c
@@ -112,7 +112,7 @@ static int erase_and_write(loff_t ofs, unsigned char *data,
newstats.corrected - oldstats.corrected,
ofs + memregion.offset + i);
init_progression_bar(length);
- show_progress(ofs);
+ show_progress(ofs + i);
if ((newstats.corrected-oldstats.corrected) >=
MAX_ECC_BITS) {
/* Increment ECC stats that
@@ -130,7 +130,7 @@ static int erase_and_write(loff_t ofs, unsigned char *data,
printf("\nECC failed at page 0x%08llx\n",
ofs + memregion.offset + i);
init_progression_bar(length);
- show_progress(ofs);
+ show_progress(ofs + i);
oldstats.failed = newstats.failed;
ecc_failed_cnt++;
}
@@ -292,8 +292,8 @@ static int do_nandtest(int argc, char *argv[])
for (iter = 0; iter < nr_iterations; iter++) {
init_progression_bar(length);
- for (test_ofs = flash_offset;
- test_ofs < flash_offset + length;
+ for (test_ofs = 0;
+ test_ofs < length;
test_ofs += meminfo.erasesize) {
show_progress(test_ofs);
srand(seed);