diff options
author | Simon Glass <sjg@chromium.org> | 2017-08-03 12:22:10 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-08-16 08:23:32 -0400 |
commit | 018f530323b2cc41be05be5b12375d3648f06554 (patch) | |
tree | b397b84a059e5b704c20c9097577ada6fc4ba296 /cmd | |
parent | 382bee57f19b4454e2015bc19a010bc2d0ab9337 (diff) |
env: Rename common functions related to setenv()
We are now using an env_ prefix for environment functions. Rename these
commonly used functions, for consistency. Also add function comments in
common.h.
Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/cbfs.c | 2 | ||||
-rw-r--r-- | cmd/cramfs.c | 2 | ||||
-rw-r--r-- | cmd/fdt.c | 4 | ||||
-rw-r--r-- | cmd/jffs2.c | 2 | ||||
-rw-r--r-- | cmd/load.c | 6 | ||||
-rw-r--r-- | cmd/lzmadec.c | 2 | ||||
-rw-r--r-- | cmd/mtdparts.c | 2 | ||||
-rw-r--r-- | cmd/nand.c | 6 | ||||
-rw-r--r-- | cmd/nvedit.c | 6 | ||||
-rw-r--r-- | cmd/reiser.c | 2 | ||||
-rw-r--r-- | cmd/setexpr.c | 4 | ||||
-rw-r--r-- | cmd/tpm.c | 4 | ||||
-rw-r--r-- | cmd/trace.c | 12 | ||||
-rw-r--r-- | cmd/unzip.c | 2 | ||||
-rw-r--r-- | cmd/ximg.c | 4 | ||||
-rw-r--r-- | cmd/zfs.c | 2 | ||||
-rw-r--r-- | cmd/zip.c | 2 |
17 files changed, 32 insertions, 32 deletions
diff --git a/cmd/cbfs.c b/cmd/cbfs.c index 95a11a36160..799ba01fcc8 100644 --- a/cmd/cbfs.c +++ b/cmd/cbfs.c @@ -80,7 +80,7 @@ static int do_cbfs_fsload(cmd_tbl_t *cmdtp, int flag, int argc, printf("\n%ld bytes read\n", size); - setenv_hex("filesize", size); + env_set_hex("filesize", size); return 0; } diff --git a/cmd/cramfs.c b/cmd/cramfs.c index 49ee36c74ae..7b23c5b3dd5 100644 --- a/cmd/cramfs.c +++ b/cmd/cramfs.c @@ -138,7 +138,7 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (size > 0) { printf("### CRAMFS load complete: %d bytes loaded to 0x%lx\n", size, offset); - setenv_hex("filesize", size); + env_set_hex("filesize", size); } else { printf("### CRAMFS LOAD ERROR<%x> for %s!\n", size, filename); } diff --git a/cmd/fdt.c b/cmd/fdt.c index 7af9bfec5fc..eb01a889ad2 100644 --- a/cmd/fdt.c +++ b/cmd/fdt.c @@ -43,7 +43,7 @@ void set_working_fdt_addr(ulong addr) buf = map_sysmem(addr, 0); working_fdt = buf; - setenv_hex("fdtaddr", addr); + env_set_hex("fdtaddr", addr); } /* @@ -373,7 +373,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } if (subcmd[0] == 's') { /* get the num nodes at this level */ - setenv_ulong(var, curIndex + 1); + env_set_ulong(var, curIndex + 1); } else { /* node index not found */ printf("libfdt node not found\n"); diff --git a/cmd/jffs2.c b/cmd/jffs2.c index dc94705ccd7..add89dee6ab 100644 --- a/cmd/jffs2.c +++ b/cmd/jffs2.c @@ -512,7 +512,7 @@ int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (size > 0) { printf("### %s load complete: %d bytes loaded to 0x%lx\n", fsname, size, offset); - setenv_hex("filesize", size); + env_set_hex("filesize", size); } else { printf("### %s LOAD ERROR<%x> for %s!\n", fsname, size, filename); } diff --git a/cmd/load.c b/cmd/load.c index 4597ec5618d..ec3730e0f6c 100644 --- a/cmd/load.c +++ b/cmd/load.c @@ -182,7 +182,7 @@ static ulong load_serial(long offset) start_addr, end_addr, size, size ); flush_cache(start_addr, size); - setenv_hex("filesize", size); + env_set_hex("filesize", size); return (addr); case SREC_START: break; @@ -529,7 +529,7 @@ static ulong load_serial_bin(ulong offset) flush_cache(offset, size); printf("## Total Size = 0x%08x = %d Bytes\n", size, size); - setenv_hex("filesize", size); + env_set_hex("filesize", size); return offset; } @@ -1000,7 +1000,7 @@ static ulong load_serial_ymodem(ulong offset, int mode) flush_cache(offset, ALIGN(size, ARCH_DMA_MINALIGN)); printf("## Total Size = 0x%08x = %d Bytes\n", size, size); - setenv_hex("filesize", size); + env_set_hex("filesize", size); return offset; } diff --git a/cmd/lzmadec.c b/cmd/lzmadec.c index c78df825e84..1b482edb587 100644 --- a/cmd/lzmadec.c +++ b/cmd/lzmadec.c @@ -42,7 +42,7 @@ static int do_lzmadec(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) return 1; printf("Uncompressed size: %ld = %#lX\n", (ulong)src_len, (ulong)src_len); - setenv_hex("filesize", src_len); + env_set_hex("filesize", src_len); return 0; } diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c index a2433503c40..d3fde77ef0c 100644 --- a/cmd/mtdparts.c +++ b/cmd/mtdparts.c @@ -239,7 +239,7 @@ static void index_partitions(void) dev = list_entry(dentry, struct mtd_device, link); if (dev == current_mtd_dev) { mtddevnum += current_mtd_partnum; - setenv_ulong("mtddevnum", mtddevnum); + env_set_ulong("mtddevnum", mtddevnum); break; } mtddevnum += dev->num_parts; diff --git a/cmd/nand.c b/cmd/nand.c index a2152ec8260..0f5d431e5c4 100644 --- a/cmd/nand.c +++ b/cmd/nand.c @@ -305,9 +305,9 @@ static void nand_print_and_set_info(int idx) printf(" bbt options 0x%08x\n", chip->bbt_options); /* Set geometry info */ - setenv_hex("nand_writesize", mtd->writesize); - setenv_hex("nand_oobsize", mtd->oobsize); - setenv_hex("nand_erasesize", mtd->erasesize); + env_set_hex("nand_writesize", mtd->writesize); + env_set_hex("nand_oobsize", mtd->oobsize); + env_set_hex("nand_erasesize", mtd->erasesize); } static int raw_access(struct mtd_info *mtd, ulong addr, loff_t off, diff --git a/cmd/nvedit.c b/cmd/nvedit.c index 1b1e9667b53..a649004850c 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -304,7 +304,7 @@ int env_set(const char *varname, const char *varvalue) * @param value Value to set it to * @return 0 if ok, 1 on error */ -int setenv_ulong(const char *varname, ulong value) +int env_set_ulong(const char *varname, ulong value) { /* TODO: this should be unsigned */ char *str = simple_itoa(value); @@ -319,7 +319,7 @@ int setenv_ulong(const char *varname, ulong value) * @param value Value to set it to * @return 0 if ok, 1 on error */ -int setenv_hex(const char *varname, ulong value) +int env_set_hex(const char *varname, ulong value) { char str[17]; @@ -957,7 +957,7 @@ NXTARG: ; envp->flags = ACTIVE_FLAG; #endif } - setenv_hex("filesize", len + offsetof(env_t, data)); + env_set_hex("filesize", len + offsetof(env_t, data)); return 0; diff --git a/cmd/reiser.c b/cmd/reiser.c index 9c3e9e9e582..4df9c5f5db1 100644 --- a/cmd/reiser.c +++ b/cmd/reiser.c @@ -157,7 +157,7 @@ int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) load_addr = addr; printf ("\n%ld bytes read\n", filelen); - setenv_hex("filesize", filelen); + env_set_hex("filesize", filelen); return filelen; } diff --git a/cmd/setexpr.c b/cmd/setexpr.c index e9058c4a0ac..91a5a9a770b 100644 --- a/cmd/setexpr.c +++ b/cmd/setexpr.c @@ -314,7 +314,7 @@ static int do_setexpr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) /* plain assignment: "setexpr name value" */ if (argc == 3) { - setenv_hex(argv[1], a); + env_set_hex(argv[1], a); return 0; } @@ -370,7 +370,7 @@ static int do_setexpr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 1; } - setenv_hex(argv[1], value); + env_set_hex(argv[1], value); return 0; } diff --git a/cmd/tpm.c b/cmd/tpm.c index 0c4bc73ca64..d9b433582c1 100644 --- a/cmd/tpm.c +++ b/cmd/tpm.c @@ -231,7 +231,7 @@ static int type_string_write_vars(const char *type_str, uint8_t *data, default: return -1; } - if (setenv_ulong(*vars, value)) + if (env_set_ulong(*vars, value)) return -1; } @@ -624,7 +624,7 @@ static int do_tpm_load_key_by_sha1(cmd_tbl_t *cmdtp, int flag, int argc, char * &key_handle); if (!err) { printf("Key handle is 0x%x\n", key_handle); - setenv_hex("key_handle", key_handle); + env_set_hex("key_handle", key_handle); } return report_return_code(err); diff --git a/cmd/trace.c b/cmd/trace.c index 1a6d8c30474..e6c08e4ba56 100644 --- a/cmd/trace.c +++ b/cmd/trace.c @@ -46,9 +46,9 @@ static int create_func_list(int argc, char * const argv[]) used = min(avail, (size_t)needed); printf("Function trace dumped to %08lx, size %#zx\n", (ulong)map_to_sysmem(buff + buff_ptr), used); - setenv_hex("profbase", map_to_sysmem(buff)); - setenv_hex("profsize", buff_size); - setenv_hex("profoffset", buff_ptr + used); + env_set_hex("profbase", map_to_sysmem(buff)); + env_set_hex("profsize", buff_size); + env_set_hex("profoffset", buff_ptr + used); return 0; } @@ -71,9 +71,9 @@ static int create_call_list(int argc, char * const argv[]) printf("Call list dumped to %08lx, size %#zx\n", (ulong)map_to_sysmem(buff + buff_ptr), used); - setenv_hex("profbase", map_to_sysmem(buff)); - setenv_hex("profsize", buff_size); - setenv_hex("profoffset", buff_ptr + used); + env_set_hex("profbase", map_to_sysmem(buff)); + env_set_hex("profsize", buff_size); + env_set_hex("profoffset", buff_ptr + used); return 0; } diff --git a/cmd/unzip.c b/cmd/unzip.c index a8bcb1f529d..94f883f92a3 100644 --- a/cmd/unzip.c +++ b/cmd/unzip.c @@ -29,7 +29,7 @@ static int do_unzip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 1; printf("Uncompressed size: %ld = 0x%lX\n", src_len, src_len); - setenv_hex("filesize", src_len); + env_set_hex("filesize", src_len); return 0; } diff --git a/cmd/ximg.c b/cmd/ximg.c index d033c15b629..50dc00e4f80 100644 --- a/cmd/ximg.c +++ b/cmd/ximg.c @@ -251,8 +251,8 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) flush_cache(dest, len); - setenv_hex("fileaddr", data); - setenv_hex("filesize", len); + env_set_hex("fileaddr", data); + env_set_hex("filesize", len); return 0; } diff --git a/cmd/zfs.c b/cmd/zfs.c index 3ed9912d19b..08b0062c105 100644 --- a/cmd/zfs.c +++ b/cmd/zfs.c @@ -115,7 +115,7 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] load_addr = addr; printf("%llu bytes read\n", zfile.size); - setenv_hex("filesize", zfile.size); + env_set_hex("filesize", zfile.size); return 0; } diff --git a/cmd/zip.c b/cmd/zip.c index 7fcd9d5bf87..dac75277218 100644 --- a/cmd/zip.c +++ b/cmd/zip.c @@ -30,7 +30,7 @@ static int do_zip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 1; printf("Compressed size: %ld = 0x%lX\n", dst_len, dst_len); - setenv_hex("filesize", dst_len); + env_set_hex("filesize", dst_len); return 0; } |