summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2018-06-01 17:51:26 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2018-06-06 13:12:13 +0200
commitaddb87df8d83ac36cf574abddb8b24a44b33b1f0 (patch)
tree1d4213d18367cdd307aaef5fd5de1745696d3f27
parentd507d86f8fbd51611fff18eb487d836243c0e7c5 (diff)
cmd: ubi: print load size after establishing volume size
When using static volumes, the file size stored in the volume is determined at runtime. Currently the ubi command prints the file size specified on the console, which leads to a rather confusing series of messages: # ubi read ${fdt_addr_r} testvol Read 0 bytes from volume testvol to 82000000 No size specified -> Using max size (179924992) Make sure to print the actual size read in any case: # ubi read ${fdt_addr_r} testvol No size specified -> Using max size (179924992) Read 179924992 bytes from volume testvol to 82000000 Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
-rw-r--r--cmd/ubi.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/cmd/ubi.c b/cmd/ubi.c
index 3dc4cae277..363282d1a5 100644
--- a/cmd/ubi.c
+++ b/cmd/ubi.c
@@ -356,6 +356,8 @@ int ubi_volume_read(char *volume, char *buf, size_t size)
size = vol->used_bytes;
}
+ printf("Read %u bytes from volume %s to %p\n", size, volume, buf);
+
if (vol->corrupted)
printf("read from corrupted volume %d", vol->vol_id);
if (offp + size > vol->used_bytes)
@@ -673,9 +675,6 @@ static int do_ubi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
if (argc == 3) {
- printf("Read %lld bytes from volume %s to %lx\n", size,
- argv[3], addr);
-
return ubi_volume_read(argv[3], (char *)addr, size);
}
}