]> git.sur5r.net Git - u-boot/commitdiff
env: Rename common functions related to setenv()
authorSimon Glass <sjg@chromium.org>
Thu, 3 Aug 2017 18:22:10 +0000 (12:22 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 16 Aug 2017 12:23:32 +0000 (08:23 -0400)
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>
37 files changed:
api/api.c
arch/arm/mach-tegra/tegra186/nvtboot_board.c
arch/arm/mach-uniphier/mmc-first-dev.c
board/boundary/nitrogen6x/nitrogen6x.c
board/engicam/common/board.c
board/freescale/qemu-ppce500/qemu-ppce500.c
board/grinn/liteboard/board.c
board/raspberrypi/rpi/rpi.c
board/sunxi/board.c
cmd/cbfs.c
cmd/cramfs.c
cmd/fdt.c
cmd/jffs2.c
cmd/load.c
cmd/lzmadec.c
cmd/mtdparts.c
cmd/nand.c
cmd/nvedit.c
cmd/reiser.c
cmd/setexpr.c
cmd/tpm.c
cmd/trace.c
cmd/unzip.c
cmd/ximg.c
cmd/zfs.c
cmd/zip.c
common/autoboot.c
common/board_r.c
common/bootm.c
common/bootm_os.c
drivers/bootcount/bootcount_env.c
drivers/net/fm/fm.c
drivers/scsi/scsi.c
fs/fs.c
fs/ubifs/ubifs.c
include/common.h
net/net.c

index 6ae9af74b5741cfb1a6d0ee350de67029bd79cf3..23fa1774c3c33ea7845bf24749b6659048ab3a9c 100644 (file)
--- a/api/api.c
+++ b/api/api.c
@@ -663,7 +663,7 @@ void api_init(void)
                return;
        }
 
-       setenv_hex("api_address", (unsigned long)sig);
+       env_set_hex("api_address", (unsigned long)sig);
        debugf("API sig @ 0x%lX\n", (unsigned long)sig);
        memcpy(sig->magic, API_SIG_MAGIC, 8);
        sig->version = API_SIG_VERSION;
index 56650efd4fcaa6e1dc952046eccdd8456ec1f39e..9cd3fe2f305d61f2e84916a0c65f374eec3fd83b 100644 (file)
@@ -15,7 +15,7 @@ static int set_fdt_addr(void)
 {
        int ret;
 
-       ret = setenv_hex("fdt_addr", nvtboot_boot_x0);
+       ret = env_set_hex("fdt_addr", nvtboot_boot_x0);
        if (ret) {
                printf("Failed to set fdt_addr to point at DTB: %d\n", ret);
                return ret;
index 8c45229a8953f77459cba4cf58111b135eba3365..acc859a6c3f917ce7abaaafaac13208e644ebfca 100644 (file)
@@ -35,7 +35,7 @@ static int do_mmcsetn(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        if (dev < 0)
                return CMD_RET_FAILURE;
 
-       setenv_ulong("mmc_first_dev", dev);
+       env_set_ulong("mmc_first_dev", dev);
        return CMD_RET_SUCCESS;
 }
 
index c04926c0bbed6fd9771e64c1eb613160b81b2f13..0e2c4fc0ef4a472f5e991496d396fde288b81172 100644 (file)
@@ -1021,6 +1021,6 @@ int misc_init_r(void)
 #ifdef CONFIG_CMD_BMODE
        add_board_boot_modes(board_boot_modes);
 #endif
-       setenv_hex("reset_cause", get_imx_reset_cause());
+       env_set_hex("reset_cause", get_imx_reset_cause());
        return 0;
 }
index 56112d34593664bbb3cc8440be9b33eb09538f4a..c7ec55ff825af8cdcc81f9a70898cb64d4930981 100644 (file)
@@ -21,7 +21,7 @@ static void mmc_late_init(void)
        char mmcblk[32];
        u32 dev_no = mmc_get_env_dev();
 
-       setenv_ulong("mmcdev", dev_no);
+       env_set_ulong("mmcdev", dev_no);
 
        /* Set mmcblk env */
        sprintf(mmcblk, "/dev/mmcblk%dp2 rootwait rw", dev_no);
index 0c65ec72d209602314380208143701514d851424..cf5023c505b238bfc5deca0ca753901b3e71f96b 100644 (file)
@@ -211,10 +211,10 @@ int last_stage_init(void)
        /* -kernel boot */
        prop = fdt_getprop(fdt, chosen, "qemu,boot-kernel", &len);
        if (prop && (len >= 8))
-               setenv_hex("qemu_kernel_addr", *prop);
+               env_set_hex("qemu_kernel_addr", *prop);
 
        /* Give the user a variable for the host fdt */
-       setenv_hex("fdt_addr_r", (ulong)fdt);
+       env_set_hex("fdt_addr_r", (ulong)fdt);
 
        return 0;
 }
index 835be99b961e4cb5c8f657c1ee8e31c06121c34f..24956927ac44d16039d4b3e33f86e185558e8023 100644 (file)
@@ -168,7 +168,7 @@ void board_late_mmc_init(void)
        if (!check_mmc_autodetect())
                return;
 
-       setenv_ulong("mmcdev", dev_no);
+       env_set_ulong("mmcdev", dev_no);
 
        /* Set mmcblk env */
        sprintf(mmcblk, "/dev/mmcblk%dp2 rootwait rw",
index c1985fd41839e24cdd345e8b78992f9143c0a013..aaa3a42abf59762763ffa1965022a944d1dd6c59 100644 (file)
@@ -266,7 +266,7 @@ static void set_fdt_addr(void)
        if (fdt_magic(fw_dtb_pointer) != FDT_MAGIC)
                return;
 
-       setenv_hex("fdt_addr", fw_dtb_pointer);
+       env_set_hex("fdt_addr", fw_dtb_pointer);
 }
 
 /*
index b1fcd9d0b90ac9ced69271509e28a2968e856f6a..92fa6c897493756854a3bb7e2d03ca00ff43b5dd 100644 (file)
@@ -646,7 +646,7 @@ static void parse_spl_header(const uint32_t spl_addr)
                return;
        }
        /* otherwise assume .scr format (mkimage-type script) */
-       setenv_hex("fel_scriptaddr", spl->fel_script_address);
+       env_set_hex("fel_scriptaddr", spl->fel_script_address);
 }
 
 /*
index 95a11a36160aa955339b227c0d6e4a8cb17c7ec8..799ba01fcc8efbfb14a6a5b5f80947e37cb23d22 100644 (file)
@@ -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;
 }
index 49ee36c74aec81cbdb512d0e46526ba7cce380e0..7b23c5b3dd5538a1ac7a4589d4b4039b6fbcd0fe 100644 (file)
@@ -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);
        }
index 7af9bfec5fc251d3ce273edf2e3d41a3d831407a..eb01a889ad2e585ccbf2ab5e91261b547dfa93c7 100644 (file)
--- 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");
index dc94705ccd73ee87b9ee140905957aef99445a47..add89dee6ab5dbe1ad006b86fdd7f232562b5f68 100644 (file)
@@ -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);
                }
index 4597ec5618da2df839af0703541f3ce6087a7bb0..ec3730e0f6c0f37055db7f11fb7a898214c1373a 100644 (file)
@@ -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;
 }
index c78df825e84b6c6ea2a0300142d88de75f5fda81..1b482edb587dc3fd8a8c4a0b92f5f6295d0f897b 100644 (file)
@@ -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;
 }
index a2433503c40da738925f06921084462b6c5baf4b..d3fde77ef0cb91587fb462bbd40f23e47b5a2f76 100644 (file)
@@ -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;
index a2152ec8260e0546a5a19dbfd9bec8d0201ac7a3..0f5d431e5c42323eb0b6b768b6f8051be7e779a5 100644 (file)
@@ -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,
index 1b1e9667b539babd06b91412cca89166ab0322e4..a649004850c5e0b6b3c33dd29c4381e1791e8783 100644 (file)
@@ -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;
 
index 9c3e9e9e582be7e19d1dcc8106397867fce6ae66..4df9c5f5db119e1f696b9f26e145b11d35197116 100644 (file)
@@ -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;
 }
index e9058c4a0ac84ccbba8b03ab22d0d9211e7c1896..91a5a9a770b47184282c8d231442f7ebbb707d4b 100644 (file)
@@ -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;
 }
index 0c4bc73ca6455d62d47b046c32401a3204e4e58a..d9b433582c1a4cad5dfb401b230e6861fed6256d 100644 (file)
--- 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);
index 1a6d8c304746214689a6edbb5891593e6a6c82a3..e6c08e4ba564598ff8de2263162a27f5f4d824e4 100644 (file)
@@ -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;
 }
index a8bcb1f529d2e60df610d44d9c3a6dbc498ce3f0..94f883f92a356cc7ff774192075ef0a7709de171 100644 (file)
@@ -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;
 }
index d033c15b629cf2a88823bde658110dde23da2903..50dc00e4f80ba8d63fd874057c5131e16a189f0d 100644 (file)
@@ -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;
 }
index 3ed9912d19bd4d43a310233ff87e30a24917fcf9..08b0062c1058d195fa9e46bf7e4bf32197f46768 100644 (file)
--- 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;
 }
index 7fcd9d5bf8731f1aa9ddd10185994b1ca09e2768..dac7527721861dfbf45c736304141d7236b3b632 100644 (file)
--- 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;
 }
index c52bad84a4d0b8f89170ad0735379ea2c8034a23..41f18208c383698071bb7a7d943924c174dd1160 100644 (file)
@@ -278,12 +278,12 @@ static void process_fdt_options(const void *blob)
        /* Add an env variable to point to a kernel payload, if available */
        addr = fdtdec_get_config_int(gd->fdt_blob, "kernel-offset", 0);
        if (addr)
-               setenv_addr("kernaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr));
+               env_set_addr("kernaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr));
 
        /* Add an env variable to point to a root disk, if available */
        addr = fdtdec_get_config_int(gd->fdt_blob, "rootdisk-offset", 0);
        if (addr)
-               setenv_addr("rootaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr));
+               env_set_addr("rootaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr));
 #endif /* CONFIG_OF_CONTROL && CONFIG_SYS_TEXT_BASE */
 }
 
@@ -300,7 +300,7 @@ const char *bootdelay_process(void)
        bootcount = bootcount_load();
        bootcount++;
        bootcount_store(bootcount);
-       setenv_ulong("bootcount", bootcount);
+       env_set_ulong("bootcount", bootcount);
        bootlimit = getenv_ulong("bootlimit", 10, 0);
 #endif /* CONFIG_BOOTCOUNT_LIMIT */
 
index a4a7384f8b4af042f49c943203af19626b7f2b22..016dc0262c9c2f437c2b5c1a8709620ddbe87106 100644 (file)
@@ -486,7 +486,7 @@ static int initr_env(void)
        else
                set_default_env(NULL);
 #ifdef CONFIG_OF_CONTROL
-       setenv_addr("fdtcontroladdr", gd->fdt_blob);
+       env_set_addr("fdtcontroladdr", gd->fdt_blob);
 #endif
 
        /* Initialize from environment */
index f5ecc06d52a8fc6abe2b952600ac23ea4e994215..e34617a145ccbe1526e55b0b998416c25d734cff 100644 (file)
@@ -645,8 +645,8 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
                ret = boot_ramdisk_high(&images->lmb, images->rd_start,
                        rd_len, &images->initrd_start, &images->initrd_end);
                if (!ret) {
-                       setenv_hex("initrd_start", images->initrd_start);
-                       setenv_hex("initrd_end", images->initrd_end);
+                       env_set_hex("initrd_start", images->initrd_start);
+                       env_set_hex("initrd_end", images->initrd_end);
                }
        }
 #endif
index d9e6e937f7ca627852d595ff23496b8d5af86fce..86a37cb925af9250e21353d68663e47a42162c9d 100644 (file)
@@ -23,7 +23,7 @@ static int do_bootm_standalone(int flag, int argc, char * const argv[],
        /* Don't start if "autostart" is set to "no" */
        s = getenv("autostart");
        if ((s != NULL) && !strcmp(s, "no")) {
-               setenv_hex("filesize", images->os.image_len);
+               env_set_hex("filesize", images->os.image_len);
                return 0;
        }
        appl = (int (*)(int, char * const []))images->ep;
index 7f22dd0748caeca5216b3c26f42c6e6db7dfd810..ec5f9426760242401c9d23f11556d49aeb69fb28 100644 (file)
@@ -13,7 +13,7 @@ void bootcount_store(ulong a)
        int upgrade_available = getenv_ulong("upgrade_available", 10, 0);
 
        if (upgrade_available) {
-               setenv_ulong("bootcount", a);
+               env_set_ulong("bootcount", a);
                env_save();
        }
 }
index 9fe34ad4a98380708bb4e77b15c291440e235e80..451dfded77bf7562e69643d3639e22534a2b2beb 100644 (file)
@@ -418,7 +418,7 @@ int fm_init_common(int index, struct ccsr_fman *reg)
        rc = fman_upload_firmware(index, &reg->fm_imem, addr);
        if (rc)
                return rc;
-       setenv_addr("fman_ucode", addr);
+       env_set_addr("fman_ucode", addr);
 
        fm_init_muram(index, &reg->muram);
        fm_init_qmi(&reg->fm_qmi_common);
index f192ca597c61cbb2d8047b4a973f0530fa344007..1a65a3f9b943b58667da497b5b81526ced1c94e4 100644 (file)
@@ -682,7 +682,7 @@ int scsi_scan(bool verbose)
 
        printf("Found %d device(s).\n", scsi_max_devs);
 #ifndef CONFIG_SPL_BUILD
-       setenv_ulong("scsidevs", scsi_max_devs);
+       env_set_ulong("scsidevs", scsi_max_devs);
 #endif
        return 0;
 }
diff --git a/fs/fs.c b/fs/fs.c
index ef41b7482686ee7b23da9f3b79855899002bb36f..055dffdafdf023fa39bd4865550630537a988652 100644 (file)
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -348,7 +348,7 @@ int do_size(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
        if (fs_size(argv[3], &size) < 0)
                return CMD_RET_FAILURE;
 
-       setenv_hex("filesize", size);
+       env_set_hex("filesize", size);
 
        return 0;
 }
@@ -417,8 +417,8 @@ int do_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
        }
        puts("\n");
 
-       setenv_hex("fileaddr", addr);
-       setenv_hex("filesize", len_read);
+       env_set_hex("fileaddr", addr);
+       env_set_hex("filesize", len_read);
 
        return 0;
 }
index db29489eca7517c4a21151fcd91dbdc53b270dfc..8f1c9d167d741fe0a1b65475de10713785d29e1d 100644 (file)
@@ -941,7 +941,7 @@ int ubifs_load(char *filename, u32 addr, u32 size)
 
        err = ubifs_read(filename, (void *)(uintptr_t)addr, 0, size, &actread);
        if (err == 0) {
-               setenv_hex("filesize", actread);
+               env_set_hex("filesize", actread);
                printf("Done\n");
        }
 
index 0b543f3dba2f34a54c2d76fe773da5db7d3f60de..3f884d536e5d52efbb40b896a9826535894ba0a9 100644 (file)
@@ -349,18 +349,34 @@ int getenv_yesno(const char *var);
  */
 int env_set(const char *varname, const char *value);
 
-int setenv_ulong(const char *varname, ulong value);
-int setenv_hex(const char *varname, ulong value);
 /**
- * setenv_addr - Set an environment variable to an address in hex
+ * env_set_ulong() - set an environment variable to an integer
+ *
+ * @varname: Variable to adjust
+ * @value: Value to set for the variable (will be converted to a string)
+ * @return 0 if OK, 1 on error
+ */
+int env_set_ulong(const char *varname, ulong value);
+
+/**
+ * env_set_hex() - set an environment variable to a hex value
+ *
+ * @varname: Variable to adjust
+ * @value: Value to set for the variable (will be converted to a hex string)
+ * @return 0 if OK, 1 on error
+ */
+int env_set_hex(const char *varname, ulong value);
+
+/**
+ * env_set_addr - Set an environment variable to an address in hex
  *
  * @varname:   Environment variable to set
  * @addr:      Value to set it to
  * @return 0 if ok, 1 on error
  */
-static inline int setenv_addr(const char *varname, const void *addr)
+static inline int env_set_addr(const char *varname, const void *addr)
 {
-       return setenv_hex(varname, (ulong)addr);
+       return env_set_hex(varname, (ulong)addr);
 }
 
 #ifdef CONFIG_AUTO_COMPLETE
index 2268890ab54e7bd6ac0ef104212570f4b45b3402..be33c66b3ac6ab8e6dd80be8c735cfbbda338efc 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -616,8 +616,8 @@ restart:
                        if (net_boot_file_size > 0) {
                                printf("Bytes transferred = %d (%x hex)\n",
                                       net_boot_file_size, net_boot_file_size);
-                               setenv_hex("filesize", net_boot_file_size);
-                               setenv_hex("fileaddr", load_addr);
+                               env_set_hex("filesize", net_boot_file_size);
+                               env_set_hex("fileaddr", load_addr);
                        }
                        if (protocol != NETCONS)
                                eth_halt();