diff options
author | Simon Glass <sjg@chromium.org> | 2017-08-03 21:22:12 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-08-16 15:30:24 +0300 |
commit | 00caae6d47645e68d6e5277aceb69592b49381a6 (patch) | |
tree | c361aa0cea3093b93c1118266fe9e2b44ac6e453 /cmd | |
parent | fd1e959e91d2b0b2e853d09dd9167dfff18a616c (diff) | |
download | u-boot-00caae6d47645e68d6e5277aceb69592b49381a6.tar.xz |
env: Rename getenv/_f() to env_get()
We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.
Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.
Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/bdinfo.c | 6 | ||||
-rw-r--r-- | cmd/bootm.c | 4 | ||||
-rw-r--r-- | cmd/bootmenu.c | 4 | ||||
-rw-r--r-- | cmd/cramfs.c | 8 | ||||
-rw-r--r-- | cmd/elf.c | 26 | ||||
-rw-r--r-- | cmd/fpga.c | 4 | ||||
-rw-r--r-- | cmd/gpt.c | 4 | ||||
-rw-r--r-- | cmd/ini.c | 4 | ||||
-rw-r--r-- | cmd/itest.c | 2 | ||||
-rw-r--r-- | cmd/jffs2.c | 4 | ||||
-rw-r--r-- | cmd/load.c | 10 | ||||
-rw-r--r-- | cmd/log.c | 6 | ||||
-rw-r--r-- | cmd/md5sum.c | 2 | ||||
-rw-r--r-- | cmd/mtdparts.c | 10 | ||||
-rw-r--r-- | cmd/mvebu/bubt.c | 2 | ||||
-rw-r--r-- | cmd/nand.c | 6 | ||||
-rw-r--r-- | cmd/net.c | 4 | ||||
-rw-r--r-- | cmd/nvedit.c | 14 | ||||
-rw-r--r-- | cmd/pxe.c | 30 | ||||
-rw-r--r-- | cmd/qfw.c | 4 | ||||
-rw-r--r-- | cmd/reiser.c | 6 | ||||
-rw-r--r-- | cmd/setexpr.c | 2 | ||||
-rw-r--r-- | cmd/zfs.c | 4 |
23 files changed, 84 insertions, 82 deletions
diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c index 96d7b72df2..27ffcd55bc 100644 --- a/cmd/bdinfo.c +++ b/cmd/bdinfo.c @@ -28,7 +28,7 @@ static void print_eth(int idx) sprintf(name, "eth%iaddr", idx); else strcpy(name, "ethaddr"); - val = getenv(name); + val = env_get(name); if (!val) val = "(not set)"; printf("%-12s= %s\n", name, val); @@ -51,7 +51,7 @@ static void print_eths(void) } while (dev); printf("current eth = %s\n", eth_get_name()); - printf("ip_addr = %s\n", getenv("ipaddr")); + printf("ip_addr = %s\n", env_get("ipaddr")); } #endif @@ -141,7 +141,7 @@ static inline void print_eth_ip_addr(void) #if defined(CONFIG_HAS_ETH5) print_eth(5); #endif - printf("IP addr = %s\n", getenv("ipaddr")); + printf("IP addr = %s\n", env_get("ipaddr")); #endif } diff --git a/cmd/bootm.c b/cmd/bootm.c index daf15d9e80..df0bbe19ca 100644 --- a/cmd/bootm.c +++ b/cmd/bootm.c @@ -138,7 +138,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int bootm_maybe_autostart(cmd_tbl_t *cmdtp, const char *cmd) { - const char *ep = getenv("autostart"); + const char *ep = env_get("autostart"); if (ep && !strcmp(ep, "yes")) { char *local_args[2]; @@ -202,7 +202,7 @@ U_BOOT_CMD( #if defined(CONFIG_CMD_BOOTD) int do_bootd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - return run_command(getenv("bootcmd"), flag); + return run_command(env_get("bootcmd"), flag); } U_BOOT_CMD( diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c index 5879065c2e..870db7c1de 100644 --- a/cmd/bootmenu.c +++ b/cmd/bootmenu.c @@ -53,7 +53,7 @@ static char *bootmenu_getoption(unsigned short int n) return NULL; sprintf(name, "bootmenu_%d", n); - return getenv(name); + return env_get(name); } static void bootmenu_print_entry(void *data) @@ -483,7 +483,7 @@ int do_bootmenu(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) delay_str = argv[1]; if (!delay_str) - delay_str = getenv("bootmenu_delay"); + delay_str = env_get("bootmenu_delay"); if (delay_str) delay = (int)simple_strtol(delay_str, NULL, 10); diff --git a/cmd/cramfs.c b/cmd/cramfs.c index 7b23c5b3dd..86f1bac272 100644 --- a/cmd/cramfs.c +++ b/cmd/cramfs.c @@ -104,7 +104,7 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) struct mtdids id; ulong addr; - addr = simple_strtoul(getenv("cramfsaddr"), NULL, 16); + addr = simple_strtoul(env_get("cramfsaddr"), NULL, 16); /* hack! */ /* cramfs_* only supports NOR flash chips */ @@ -117,9 +117,9 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) part.offset = (u64)(uintptr_t) map_sysmem(addr - OFFSET_ADJUSTMENT, 0); /* pre-set Boot file name */ - if ((filename = getenv("bootfile")) == NULL) { + filename = env_get("bootfile"); + if (!filename) filename = "uImage"; - } if (argc == 2) { filename = argv[1]; @@ -169,7 +169,7 @@ int do_cramfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) struct mtdids id; ulong addr; - addr = simple_strtoul(getenv("cramfsaddr"), NULL, 16); + addr = simple_strtoul(env_get("cramfsaddr"), NULL, 16); /* hack! */ /* cramfs_* only supports NOR flash chips */ @@ -148,7 +148,7 @@ int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) unsigned long addr; /* Address of the ELF image */ unsigned long rc; /* Return value from user code */ char *sload = NULL; - const char *ep = getenv("autostart"); + const char *ep = env_get("autostart"); int rcode = 0; /* Consume 'bootelf' */ @@ -258,7 +258,7 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) * (LOCAL_MEM_LOCAL_ADRS + BOOT_LINE_OFFSET) as defined by * VxWorks BSP. For example, on PowerPC it defaults to 0x4200. */ - tmp = getenv("bootaddr"); + tmp = env_get("bootaddr"); if (!tmp) { printf("## VxWorks bootline address not specified\n"); } else { @@ -269,21 +269,21 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) * parameter. If it is not defined, we may be able to * construct the info. */ - bootline = getenv("bootargs"); + bootline = env_get("bootargs"); if (bootline) { memcpy((void *)bootaddr, bootline, max(strlen(bootline), (size_t)255)); flush_cache(bootaddr, max(strlen(bootline), (size_t)255)); } else { - tmp = getenv("bootdev"); + tmp = env_get("bootdev"); if (tmp) { strcpy(build_buf, tmp); ptr = strlen(tmp); } else printf("## VxWorks boot device not specified\n"); - tmp = getenv("bootfile"); + tmp = env_get("bootfile"); if (tmp) ptr += sprintf(build_buf + ptr, "host:%s ", tmp); @@ -295,10 +295,10 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) * The following parameters are only needed if 'bootdev' * is an ethernet device, otherwise they are optional. */ - tmp = getenv("ipaddr"); + tmp = env_get("ipaddr"); if (tmp) { ptr += sprintf(build_buf + ptr, "e=%s", tmp); - tmp = getenv("netmask"); + tmp = env_get("netmask"); if (tmp) { u32 mask = getenv_ip("netmask").s_addr; ptr += sprintf(build_buf + ptr, @@ -308,19 +308,19 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } } - tmp = getenv("serverip"); + tmp = env_get("serverip"); if (tmp) ptr += sprintf(build_buf + ptr, "h=%s ", tmp); - tmp = getenv("gatewayip"); + tmp = env_get("gatewayip"); if (tmp) ptr += sprintf(build_buf + ptr, "g=%s ", tmp); - tmp = getenv("hostname"); + tmp = env_get("hostname"); if (tmp) ptr += sprintf(build_buf + ptr, "tn=%s ", tmp); - tmp = getenv("othbootargs"); + tmp = env_get("othbootargs"); if (tmp) { strcpy(build_buf + ptr, tmp); ptr += strlen(tmp); @@ -341,12 +341,12 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) * Since E820 information is critical to the kernel, if we don't * specify these in the environments, use a default one. */ - tmp = getenv("e820data"); + tmp = env_get("e820data"); if (tmp) data = (struct e820entry *)simple_strtoul(tmp, NULL, 16); else data = (struct e820entry *)VXWORKS_E820_DATA_ADDR; - tmp = getenv("e820info"); + tmp = env_get("e820info"); if (tmp) info = (struct e820info *)simple_strtoul(tmp, NULL, 16); else diff --git a/cmd/fpga.c b/cmd/fpga.c index 016349f560..ac6f504140 100644 --- a/cmd/fpga.c +++ b/cmd/fpga.c @@ -43,8 +43,8 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) int op, dev = FPGA_INVALID_DEVICE; size_t data_size = 0; void *fpga_data = NULL; - char *devstr = getenv("fpga"); - char *datastr = getenv("fpgadata"); + char *devstr = env_get("fpga"); + char *datastr = env_get("fpgadata"); int rc = FPGA_FAIL; int wrong_parms = 0; #if defined(CONFIG_FIT) @@ -55,14 +55,14 @@ static int extract_env(const char *str, char **env) memset(s + strlen(s) - 1, '\0', 1); memmove(s, s + 2, strlen(s) - 1); - e = getenv(s); + e = env_get(s); if (e == NULL) { #ifdef CONFIG_RANDOM_UUID debug("%s unset. ", str); gen_rand_uuid_str(uuid_str, UUID_STR_FORMAT_GUID); env_set(s, uuid_str); - e = getenv(s); + e = env_get(s); if (e) { debug("Set to random.\n"); ret = 0; @@ -238,9 +238,9 @@ static int do_ini(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) section = argv[1]; file_address = (char *)simple_strtoul( - argc < 3 ? getenv("loadaddr") : argv[2], NULL, 16); + argc < 3 ? env_get("loadaddr") : argv[2], NULL, 16); file_size = (size_t)simple_strtoul( - argc < 4 ? getenv("filesize") : argv[3], NULL, 16); + argc < 4 ? env_get("filesize") : argv[3], NULL, 16); return ini_parse(file_address, file_size, ini_handler, (void *)section); } diff --git a/cmd/itest.c b/cmd/itest.c index e1896d9f97..70db04a04f 100644 --- a/cmd/itest.c +++ b/cmd/itest.c @@ -101,7 +101,7 @@ static char * evalstr(char *s) i++; } s[i] = 0; - return getenv((const char *)&s[2]); + return env_get((const char *)&s[2]); } else { return s; } diff --git a/cmd/jffs2.c b/cmd/jffs2.c index add89dee6a..aee2f4513d 100644 --- a/cmd/jffs2.c +++ b/cmd/jffs2.c @@ -479,9 +479,9 @@ int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ulong offset = load_addr; /* pre-set Boot file name */ - if ((filename = getenv("bootfile")) == NULL) { + filename = env_get("bootfile"); + if (!filename) filename = "uImage"; - } if (argc == 2) { filename = argv[1]; diff --git a/cmd/load.c b/cmd/load.c index ec3730e0f6..519c309a61 100644 --- a/cmd/load.c +++ b/cmd/load.c @@ -50,11 +50,11 @@ static int do_load_serial(cmd_tbl_t *cmdtp, int flag, int argc, load_baudrate = current_baudrate = gd->baudrate; #endif - if (((env_echo = getenv("loads_echo")) != NULL) && (*env_echo == '1')) { + env_echo = env_get("loads_echo"); + if (env_echo && *env_echo == '1') do_echo = 1; - } else { + else do_echo = 0; - } #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE if (argc >= 2) { @@ -427,9 +427,9 @@ static int do_load_serial_bin(cmd_tbl_t *cmdtp, int flag, int argc, offset = CONFIG_SYS_LOAD_ADDR; /* pre-set offset from $loadaddr */ - if ((s = getenv("loadaddr")) != NULL) { + s = env_get("loadaddr"); + if (s) offset = simple_strtoul(s, NULL, 16); - } load_baudrate = current_baudrate = gd->baudrate; @@ -71,7 +71,8 @@ void logbuff_init_ptrs(void) #endif /* Set up log version */ - if ((s = getenv ("logversion")) != NULL) + s = env_get("logversion"); + if (s) log_version = (int)simple_strtoul(s, NULL, 10); if (log_version == 2) @@ -94,7 +95,8 @@ void logbuff_init_ptrs(void) log->v2.start = log->v2.con; /* Initialize default loglevel if present */ - if ((s = getenv ("loglevel")) != NULL) + s = env_get("loglevel"); + if (s) console_loglevel = (int)simple_strtoul(s, NULL, 10); gd->flags |= GD_FLG_LOGINIT; diff --git a/cmd/md5sum.c b/cmd/md5sum.c index 1b2352ea55..c737cb23b5 100644 --- a/cmd/md5sum.c +++ b/cmd/md5sum.c @@ -54,7 +54,7 @@ static int parse_verify_sum(char *verify_str, u8 *vsum) if (strlen(verify_str) == 32) vsum_str = verify_str; else { - vsum_str = getenv(verify_str); + vsum_str = env_get(verify_str); if (vsum_str == NULL || strlen(vsum_str) != 32) return 1; } diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c index d3fde77ef0..a72668119d 100644 --- a/cmd/mtdparts.c +++ b/cmd/mtdparts.c @@ -1536,8 +1536,8 @@ static int spread_partitions(void) static const char *getenv_mtdparts(char *buf) { if (gd->flags & GD_FLG_ENV_READY) - return getenv("mtdparts"); - if (getenv_f("mtdparts", buf, MTDPARTS_MAXLEN) != -1) + return env_get("mtdparts"); + if (env_get_f("mtdparts", buf, MTDPARTS_MAXLEN) != -1) return buf; return NULL; } @@ -1741,9 +1741,9 @@ int mtdparts_init(void) } /* get variables */ - ids = getenv("mtdids"); + ids = env_get("mtdids"); parts = getenv_mtdparts(tmp_parts); - current_partition = getenv("partition"); + current_partition = env_get("partition"); /* save it for later parsing, cannot rely on current partition pointer * as 'partition' variable may be updated during init */ @@ -1850,7 +1850,7 @@ int mtdparts_init(void) current_mtd_partnum = pnum; current_save(); } - } else if (getenv("partition") == NULL) { + } else if (env_get("partition") == NULL) { debug("no partition variable set, setting...\n"); current_save(); } diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c index ea46e7b108..a1997ac0d3 100644 --- a/cmd/mvebu/bubt.c +++ b/cmd/mvebu/bubt.c @@ -98,7 +98,7 @@ static ulong get_load_addr(void) const char *addr_str; unsigned long addr; - addr_str = getenv("loadaddr"); + addr_str = env_get("loadaddr"); if (addr_str) addr = simple_strtoul(addr_str, NULL, 16); else diff --git a/cmd/nand.c b/cmd/nand.c index 0f5d431e5c..a22945d144 100644 --- a/cmd/nand.c +++ b/cmd/nand.c @@ -383,7 +383,7 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #else int quiet = 0; #endif - const char *quiet_str = getenv("quiet"); + const char *quiet_str = env_get("quiet"); int dev = nand_curr_device; int repeat = flag & CMD_FLAG_REPEAT; @@ -966,11 +966,11 @@ static int do_nandboot(cmd_tbl_t *cmdtp, int flag, int argc, switch (argc) { case 1: addr = CONFIG_SYS_LOAD_ADDR; - boot_device = getenv("bootdevice"); + boot_device = env_get("bootdevice"); break; case 2: addr = simple_strtoul(argv[1], NULL, 16); - boot_device = getenv("bootdevice"); + boot_device = env_get("bootdevice"); break; case 3: addr = simple_strtoul(argv[1], NULL, 16); @@ -181,7 +181,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, ulong addr; /* pre-set load_addr */ - s = getenv("loadaddr"); + s = env_get("loadaddr"); if (s != NULL) load_addr = simple_strtoul(s, NULL, 16); @@ -344,7 +344,7 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } } - toff = getenv("timeoffset"); + toff = env_get("timeoffset"); if (toff == NULL) net_ntp_time_offset = 0; else diff --git a/cmd/nvedit.c b/cmd/nvedit.c index a649004850..0468a4b7e9 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -333,7 +333,7 @@ ulong getenv_hex(const char *varname, ulong default_val) ulong value; char *endp; - s = getenv(varname); + s = env_get(varname); if (s) value = simple_strtoul(s, &endp, 16); if (!s || endp == s) @@ -594,7 +594,7 @@ static int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, return 1; /* Set read buffer to initial value or empty sting */ - init_val = getenv(argv[1]); + init_val = env_get(argv[1]); if (init_val) snprintf(buffer, CONFIG_SYS_CBSIZE, "%s", init_val); else @@ -622,7 +622,7 @@ static int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, * return address of storage for that variable, * or NULL if not found */ -char *getenv(const char *name) +char *env_get(const char *name) { if (gd->flags & GD_FLG_ENV_READY) { /* after import into hashtable */ ENTRY e, *ep; @@ -637,7 +637,7 @@ char *getenv(const char *name) } /* restricted capabilities before import */ - if (getenv_f(name, (char *)(gd->env_buf), sizeof(gd->env_buf)) > 0) + if (env_get_f(name, (char *)(gd->env_buf), sizeof(gd->env_buf)) > 0) return (char *)(gd->env_buf); return NULL; @@ -646,7 +646,7 @@ char *getenv(const char *name) /* * Look up variable from environment for restricted C runtime env. */ -int getenv_f(const char *name, char *buf, unsigned len) +int env_get_f(const char *name, char *buf, unsigned len) { int i, nxt; @@ -693,10 +693,10 @@ int getenv_f(const char *name, char *buf, unsigned len) ulong getenv_ulong(const char *name, int base, ulong default_val) { /* - * We can use getenv() here, even before relocation, since the + * We can use env_get() here, even before relocation, since the * environment variable value is an integer and thus short. */ - const char *str = getenv(name); + const char *str = env_get(name); return str ? simple_strtoul(str, NULL, base) : default_val; } @@ -33,15 +33,15 @@ const char *pxe_default_paths[] = { static bool is_pxe; /* - * Like getenv, but prints an error if envvar isn't defined in the - * environment. It always returns what getenv does, so it can be used in - * place of getenv without changing error handling otherwise. + * Like env_get, but prints an error if envvar isn't defined in the + * environment. It always returns what env_get does, so it can be used in + * place of env_get without changing error handling otherwise. */ static char *from_env(const char *envvar) { char *ret; - ret = getenv(envvar); + ret = env_get(envvar); if (!ret) printf("missing environment variable: %s\n", envvar); @@ -649,9 +649,9 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label) } bootm_argv[2] = initrd_str; - strcpy(bootm_argv[2], getenv("ramdisk_addr_r")); + strcpy(bootm_argv[2], env_get("ramdisk_addr_r")); strcat(bootm_argv[2], ":"); - strcat(bootm_argv[2], getenv("filesize")); + strcat(bootm_argv[2], env_get("filesize")); } if (get_relfile_envaddr(cmdtp, label->kernel, "kernel_addr_r") < 0) { @@ -662,8 +662,8 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label) if (label->ipappend & 0x1) { sprintf(ip_str, " ip=%s:%s:%s:%s", - getenv("ipaddr"), getenv("serverip"), - getenv("gatewayip"), getenv("netmask")); + env_get("ipaddr"), env_get("serverip"), + env_get("gatewayip"), env_get("netmask")); } #ifdef CONFIG_CMD_NET @@ -699,7 +699,7 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label) printf("append: %s\n", finalbootargs); } - bootm_argv[1] = getenv("kernel_addr_r"); + bootm_argv[1] = env_get("kernel_addr_r"); /* * fdt usage is optional: @@ -714,7 +714,7 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label) * * Scenario 3: fdt blob is not available. */ - bootm_argv[3] = getenv("fdt_addr_r"); + bootm_argv[3] = env_get("fdt_addr_r"); /* if fdt label is defined then get fdt from server */ if (bootm_argv[3]) { @@ -726,7 +726,7 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label) } else if (label->fdtdir) { char *f1, *f2, *f3, *f4, *slash; - f1 = getenv("fdtfile"); + f1 = env_get("fdtfile"); if (f1) { f2 = ""; f3 = ""; @@ -739,9 +739,9 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label) * or the boot scripts should set $fdtfile * before invoking "pxe" or "sysboot". */ - f1 = getenv("soc"); + f1 = env_get("soc"); f2 = "-"; - f3 = getenv("board"); + f3 = env_get("board"); f4 = ".dtb"; } @@ -781,7 +781,7 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label) } if (!bootm_argv[3]) - bootm_argv[3] = getenv("fdt_addr"); + bootm_argv[3] = env_get("fdt_addr"); if (bootm_argv[3]) { if (!bootm_argv[2]) @@ -1671,7 +1671,7 @@ static int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } if (argc < 6) - filename = getenv("bootfile"); + filename = env_get("bootfile"); else { filename = argv[5]; env_set("bootfile", filename); @@ -123,7 +123,7 @@ static int qemu_fwcfg_do_load(cmd_tbl_t *cmdtp, int flag, void *load_addr; void *initrd_addr; - env = getenv("loadaddr"); + env = env_get("loadaddr"); load_addr = env ? (void *)simple_strtoul(env, NULL, 16) : #ifdef CONFIG_LOADADDR @@ -132,7 +132,7 @@ static int qemu_fwcfg_do_load(cmd_tbl_t *cmdtp, int flag, NULL; #endif - env = getenv("ramdiskaddr"); + env = env_get("ramdiskaddr"); initrd_addr = env ? (void *)simple_strtoul(env, NULL, 16) : #ifdef CONFIG_RAMDISK_ADDR diff --git a/cmd/reiser.c b/cmd/reiser.c index 4df9c5f5db..e10c7b9eba 100644 --- a/cmd/reiser.c +++ b/cmd/reiser.c @@ -88,18 +88,18 @@ int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) switch (argc) { case 3: - addr_str = getenv("loadaddr"); + addr_str = env_get("loadaddr"); if (addr_str != NULL) { addr = simple_strtoul (addr_str, NULL, 16); } else { addr = CONFIG_SYS_LOAD_ADDR; } - filename = getenv ("bootfile"); + filename = env_get("bootfile"); count = 0; break; case 4: addr = simple_strtoul (argv[3], NULL, 16); - filename = getenv ("bootfile"); + filename = env_get("bootfile"); count = 0; break; case 5: diff --git a/cmd/setexpr.c b/cmd/setexpr.c index 91a5a9a770..af210225f1 100644 --- a/cmd/setexpr.c +++ b/cmd/setexpr.c @@ -145,7 +145,7 @@ static int regex_sub(const char *name, } if (t == NULL) { - value = getenv(name); + value = env_get(name); if (value == NULL) { printf("## Error: variable \"%s\" not defined\n", name); @@ -51,10 +51,10 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] count = 0; addr = simple_strtoul(argv[3], NULL, 16); - filename = getenv("bootfile"); + filename = env_get("bootfile"); switch (argc) { case 3: - addr_str = getenv("loadaddr"); + addr_str = env_get("loadaddr"); if (addr_str != NULL) addr = simple_strtoul(addr_str, NULL, 16); else |