summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/mtd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/mtd.c b/cmd/mtd.c
index 689d8d11655..e415a2d7f02 100644
--- a/cmd/mtd.c
+++ b/cmd/mtd.c
@@ -469,7 +469,7 @@ static int do_mtd_io(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
bool dump, read, raw, woob, benchmark, write_empty_pages, has_pages = false;
- u64 start_off, off, len, remaining, default_len;
+ u64 start_off, off, len, remaining, default_len, speed;
unsigned long bench_start, bench_end;
struct mtd_oob_ops io_op = {};
uint user_addr = 0, npages;
@@ -595,9 +595,10 @@ static int do_mtd_io(struct cmd_tbl *cmdtp, int flag, int argc,
if (benchmark && bench_start) {
bench_end = timer_get_us();
+ speed = (len * 1000000) / (bench_end - bench_start);
printf("%s speed: %lukiB/s\n",
read ? "Read" : "Write",
- ((io_op.len * 1000000) / (bench_end - bench_start)) / 1024);
+ (unsigned long)(speed / 1024));
}
led_activity_off();