From 70d7cb92528c88b7e0db841d94383d8d0fb350f3 Mon Sep 17 00:00:00 2001 From: "Robert P. J. Day" Date: Sun, 3 Feb 2013 05:46:13 +0000 Subject: cmd_load.c: Add #endif comments to reduce confusion Signed-off-by: Robert P. J. Day --- common/cmd_load.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'common/cmd_load.c') diff --git a/common/cmd_load.c b/common/cmd_load.c index 2c8dab1..46db962 100644 --- a/common/cmd_load.c +++ b/common/cmd_load.c @@ -1064,8 +1064,8 @@ U_BOOT_CMD( " - save S-Record file over serial line with offset 'off' and size 'size'" ); #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */ -#endif -#endif +#endif /* CONFIG_CMD_SAVES */ +#endif /* CONFIG_CMD_LOADS */ #if defined(CONFIG_CMD_LOADB) @@ -1085,7 +1085,7 @@ U_BOOT_CMD( " with offset 'off' and baudrate 'baud'" ); -#endif +#endif /* CONFIG_CMD_LOADB */ /* -------------------------------------------------------------------- */ @@ -1115,4 +1115,4 @@ U_BOOT_CMD( "[on|off]" ); -#endif +#endif /* CONFIG_CMD_HWFLOW */ -- cgit v1.1 From 41ef372c1a2d344621c74aa4bce5cdb0970ba5f1 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 24 Feb 2013 17:33:22 +0000 Subject: common: Use new numeric setenv functions Use setenv_ulong(), setenv_hex() and setenv_addr() in common/ Signed-off-by: Simon Glass --- common/cmd_load.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'common/cmd_load.c') 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; } -- cgit v1.1