summaryrefslogtreecommitdiffstats
path: root/common/cmd_bootm.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_bootm.c
parentbfc59966431e6335fd5be0589eec073902cc7bb3 (diff)
downloadtalos-obmc-uboot-41ef372c1a2d344621c74aa4bce5cdb0970ba5f1.tar.gz
talos-obmc-uboot-41ef372c1a2d344621c74aa4bce5cdb0970ba5f1.zip
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_bootm.c')
-rw-r--r--common/cmd_bootm.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 1312a0db8a..b32991da0d 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -452,9 +452,7 @@ static int bootm_start_standalone(ulong iflag, int argc, char * const argv[])
/* Don't start if "autostart" is set to "no" */
if (((s = getenv("autostart")) != NULL) && (strcmp(s, "no") == 0)) {
- char buf[32];
- sprintf(buf, "%lX", images.os.image_len);
- setenv("filesize", buf);
+ setenv_hex("filesize", images.os.image_len);
return 0;
}
appl = (int (*)(int, char * const []))(ulong)ntohl(images.ep);
@@ -529,17 +527,14 @@ static int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc,
case BOOTM_STATE_RAMDISK:
{
ulong rd_len = images.rd_end - images.rd_start;
- char str[17];
ret = boot_ramdisk_high(&images.lmb, images.rd_start,
rd_len, &images.initrd_start, &images.initrd_end);
if (ret)
return ret;
- sprintf(str, "%lx", images.initrd_start);
- setenv("initrd_start", str);
- sprintf(str, "%lx", images.initrd_end);
- setenv("initrd_end", str);
+ setenv_hex("initrd_start", images.initrd_start);
+ setenv_hex("initrd_end", images.initrd_end);
}
break;
#endif
OpenPOWER on IntegriCloud