diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/blk_common.c | 10 | ||||
-rw-r--r-- | cmd/mmc.c | 2 | ||||
-rw-r--r-- | cmd/ubi.c | 5 |
3 files changed, 9 insertions, 8 deletions
diff --git a/cmd/blk_common.c b/cmd/blk_common.c index 86c75e7..0c0c23e 100644 --- a/cmd/blk_common.c +++ b/cmd/blk_common.c @@ -68,9 +68,8 @@ int blk_common_cmd(int argc, char * const argv[], enum if_type if_type, ulong cnt = simple_strtoul(argv[4], NULL, 16); ulong n; - printf("\n%s read: device %d block # %lld, count %ld ... ", - if_name, *cur_devnump, (unsigned long long)blk, - cnt); + printf("\n%s read: device %d block # "LBAFU", count %lu ... ", + if_name, *cur_devnump, blk, cnt); n = blk_read_devnum(if_type, *cur_devnump, blk, cnt, (ulong *)addr); @@ -84,9 +83,8 @@ int blk_common_cmd(int argc, char * const argv[], enum if_type if_type, ulong cnt = simple_strtoul(argv[4], NULL, 16); ulong n; - printf("\n%s write: device %d block # %lld, count %ld ... ", - if_name, *cur_devnump, (unsigned long long)blk, - cnt); + printf("\n%s write: device %d block # "LBAFU", count %lu ... ", + if_name, *cur_devnump, blk, cnt); n = blk_write_devnum(if_type, *cur_devnump, blk, cnt, (ulong *)addr); @@ -293,8 +293,6 @@ static int do_mmc_read(cmd_tbl_t *cmdtp, int flag, curr_device, blk, cnt); n = blk_dread(mmc_get_blk_desc(mmc), blk, cnt, addr); - /* flush cache after read */ - flush_cache((ulong)addr, cnt * 512); /* FIXME */ printf("%d blocks read: %s\n", n, (n == cnt) ? "OK" : "ERROR"); return (n == cnt) ? CMD_RET_SUCCESS : CMD_RET_FAILURE; @@ -334,6 +334,7 @@ int ubi_volume_read(char *volume, char *buf, size_t size) unsigned long long tmp; struct ubi_volume *vol; loff_t offp = 0; + size_t len_read; vol = ubi_find_volume(volume); if (vol == NULL) @@ -373,6 +374,7 @@ int ubi_volume_read(char *volume, char *buf, size_t size) tmp = offp; off = do_div(tmp, vol->usable_leb_size); lnum = tmp; + len_read = size; do { if (off + len >= vol->usable_leb_size) len = vol->usable_leb_size - off; @@ -398,6 +400,9 @@ int ubi_volume_read(char *volume, char *buf, size_t size) len = size > tbuf_size ? tbuf_size : size; } while (size); + if (!size) + env_set_hex("filesize", len_read); + free(tbuf); return err; } |