summaryrefslogtreecommitdiff
path: root/common/cmd_load.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2013-02-24 17:33:22 +0000
committerSimon Glass <sjg@chromium.org>2013-02-28 19:09:23 -0800
commit41ef372c1a2d344621c74aa4bce5cdb0970ba5f1 (patch)
tree9abdeda0b3b87a70e4f3929e83ddd15f4704377f /common/cmd_load.c
parentbfc59966431e6335fd5be0589eec073902cc7bb3 (diff)
downloadu-boot-imx-41ef372c1a2d344621c74aa4bce5cdb0970ba5f1.zip
u-boot-imx-41ef372c1a2d344621c74aa4bce5cdb0970ba5f1.tar.gz
u-boot-imx-41ef372c1a2d344621c74aa4bce5cdb0970ba5f1.tar.bz2
common: Use new numeric setenv functions
Use setenv_ulong(), setenv_hex() and setenv_addr() in common/ Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/cmd_load.c')
-rw-r--r--common/cmd_load.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/common/cmd_load.c b/common/cmd_load.c
index 46db962..0832e92 100644
--- a/common/cmd_load.c
+++ b/common/cmd_load.c
@@ -149,7 +149,6 @@ static ulong load_serial(long offset)
int type; /* return code for record type */
ulong addr; /* load address from S-Record */
ulong size; /* number of bytes transferred */
- char buf[32];
ulong store_addr;
ulong start_addr = ~0;
ulong end_addr = 0;
@@ -198,8 +197,7 @@ static ulong load_serial(long offset)
start_addr, end_addr, size, size
);
flush_cache(start_addr, size);
- sprintf(buf, "%lX", size);
- setenv("filesize", buf);
+ setenv_hex("filesize", size);
return (addr);
case SREC_START:
break;
@@ -519,7 +517,6 @@ static int do_load_serial_bin(cmd_tbl_t *cmdtp, int flag, int argc,
static ulong load_serial_bin(ulong offset)
{
int size, i;
- char buf[32];
set_kerm_bin_mode((ulong *) offset);
size = k_recv();
@@ -539,8 +536,7 @@ static ulong load_serial_bin(ulong offset)
flush_cache(offset, size);
printf("## Total Size = 0x%08x = %d Bytes\n", size, size);
- sprintf(buf, "%X", size);
- setenv("filesize", buf);
+ setenv_hex("filesize", size);
return offset;
}
@@ -965,7 +961,6 @@ static int getcxmodem(void) {
static ulong load_serial_ymodem(ulong offset)
{
int size;
- char buf[32];
int err;
int res;
connection_info_t info;
@@ -1012,8 +1007,7 @@ static ulong load_serial_ymodem(ulong offset)
flush_cache(offset, size);
printf("## Total Size = 0x%08x = %d Bytes\n", size, size);
- sprintf(buf, "%X", size);
- setenv("filesize", buf);
+ setenv_hex("filesize", size);
return offset;
}