summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-08-03 12:22:09 -0600
committerTom Rini <trini@konsulko.com>2017-08-16 08:22:18 -0400
commit382bee57f19b4454e2015bc19a010bc2d0ab9337 (patch)
tree8c13efda2a6539cdbf1ac76fc458ffef1e9c966d /common
parent01510091de905c46620757b9027b2e55c4b3b313 (diff)
env: Rename setenv() to env_set()
We are now using an env_ prefix for environment functions. Rename setenv() 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 'common')
-rw-r--r--common/board_r.c2
-rw-r--r--common/bootm.c2
-rw-r--r--common/cli_hush.c2
-rw-r--r--common/console.c4
-rw-r--r--common/hash.c2
-rw-r--r--common/hwconfig.c4
-rw-r--r--common/image-android.c2
-rw-r--r--common/main.c2
-rw-r--r--common/spl/Kconfig2
-rw-r--r--common/spl/spl_dfu.c2
-rw-r--r--common/spl/spl_net.c4
-rw-r--r--common/update.c4
12 files changed, 16 insertions, 16 deletions
diff --git a/common/board_r.c b/common/board_r.c
index 985aa95c2a..a4a7384f8b 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -658,7 +658,7 @@ int initr_mem(void)
pram += (LOGBUFF_LEN + LOGBUFF_OVERHEAD) / 1024;
# endif
sprintf(memsz, "%ldk", (long int) ((gd->ram_size / 1024) - pram));
- setenv("mem", memsz);
+ env_set("mem", memsz);
return 0;
}
diff --git a/common/bootm.c b/common/bootm.c
index b2c09126ce..f5ecc06d52 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -569,7 +569,7 @@ static void fixup_silent_linux(void)
env_val = CONSOLE_ARG;
}
- setenv("bootargs", env_val);
+ env_set("bootargs", env_val);
debug("after silent fix-up: %s\n", env_val);
free(buf);
}
diff --git a/common/cli_hush.c b/common/cli_hush.c
index 00861e2d9e..280289639c 100644
--- a/common/cli_hush.c
+++ b/common/cli_hush.c
@@ -2265,7 +2265,7 @@ void unset_local_var(const char *name)
} else {
#ifndef __U_BOOT__
if(cur->flg_export)
- unsetenv(cur->name);
+ unenv_set(cur->name);
#endif
free(cur->name);
free(cur->value);
diff --git a/common/console.c b/common/console.c
index ec4af3bd90..3f7ca2baa7 100644
--- a/common/console.c
+++ b/common/console.c
@@ -801,7 +801,7 @@ done:
#ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
/* set the environment variables (will overwrite previous env settings) */
for (i = 0; i < 3; i++) {
- setenv(stdio_names[i], stdio_devices[i]->name);
+ env_set(stdio_names[i], stdio_devices[i]->name);
}
#endif /* CONFIG_SYS_CONSOLE_ENV_OVERWRITE */
@@ -880,7 +880,7 @@ int console_init_r(void)
/* Setting environment variables */
for (i = 0; i < 3; i++) {
- setenv(stdio_names[i], stdio_devices[i]->name);
+ env_set(stdio_names[i], stdio_devices[i]->name);
}
gd->flags |= GD_FLG_DEVINIT; /* device initialization completed */
diff --git a/common/hash.c b/common/hash.c
index 771d8fa87f..fda636d34a 100644
--- a/common/hash.c
+++ b/common/hash.c
@@ -302,7 +302,7 @@ static void store_result(struct hash_algo *algo, const uint8_t *sum,
str_ptr += 2;
}
*str_ptr = '\0';
- setenv(dest, str_output);
+ env_set(dest, str_output);
} else {
ulong addr;
void *buf;
diff --git a/common/hwconfig.c b/common/hwconfig.c
index 4ae042ee33..85aaabbb85 100644
--- a/common/hwconfig.c
+++ b/common/hwconfig.c
@@ -243,7 +243,7 @@ int main()
const char *ret;
size_t len;
- setenv("hwconfig", "key1:subkey1=value1,subkey2=value2;key2:value3;;;;"
+ env_set("hwconfig", "key1:subkey1=value1,subkey2=value2;key2:value3;;;;"
"key3;:,:=;key4", 1);
ret = hwconfig_arg("key1", &len);
@@ -274,7 +274,7 @@ int main()
assert(hwconfig_arg("key4", &len) == NULL);
assert(hwconfig_arg("bogus", &len) == NULL);
- unsetenv("hwconfig");
+ unenv_set("hwconfig");
assert(hwconfig(NULL) == 0);
assert(hwconfig("") == 0);
diff --git a/common/image-android.c b/common/image-android.c
index c668407817..018c7594fe 100644
--- a/common/image-android.c
+++ b/common/image-android.c
@@ -90,7 +90,7 @@ int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify,
if (*hdr->cmdline)
strcat(newbootargs, hdr->cmdline);
- setenv("bootargs", newbootargs);
+ env_set("bootargs", newbootargs);
if (os_data) {
*os_data = (ulong)hdr;
diff --git a/common/main.c b/common/main.c
index 2116a9e0a2..07fc31b716 100644
--- a/common/main.c
+++ b/common/main.c
@@ -48,7 +48,7 @@ void main_loop(void)
bootstage_mark_name(BOOTSTAGE_ID_MAIN_LOOP, "main_loop");
#ifdef CONFIG_VERSION_VARIABLE
- setenv("ver", version_string); /* set version variable */
+ env_set("ver", version_string); /* set version variable */
#endif /* CONFIG_VERSION_VARIABLE */
cli_init();
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 5176857506..3c887b3405 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -279,7 +279,7 @@ config SPL_ENV_SUPPORT
configuration. But some boards use this to support 'Falcon' boot
on EXT2 and FAT, where SPL boots directly into Linux without
starting U-Boot first. Enabling this option will make getenv()
- and setenv() available in SPL.
+ and env_set() available in SPL.
config SPL_SAVEENV
bool "Support save environment"
diff --git a/common/spl/spl_dfu.c b/common/spl/spl_dfu.c
index e8d0ba18e6..f5ec0fb396 100644
--- a/common/spl/spl_dfu.c
+++ b/common/spl/spl_dfu.c
@@ -46,7 +46,7 @@ int spl_dfu_cmd(int usbctrl, char *dfu_alt_info, char *interface, char *devstr)
return -EINVAL;
}
- ret = setenv("dfu_alt_info", str_env);
+ ret = env_set("dfu_alt_info", str_env);
if (ret) {
error("unable to set env variable \"dfu_alt_info\"!\n");
return -EINVAL;
diff --git a/common/spl/spl_net.c b/common/spl/spl_net.c
index 85fe508b17..88831097fa 100644
--- a/common/spl/spl_net.c
+++ b/common/spl/spl_net.c
@@ -33,14 +33,14 @@ static int spl_net_load_image(struct spl_image_info *spl_image,
env_init();
env_relocate();
- setenv("autoload", "yes");
+ env_set("autoload", "yes");
rv = eth_initialize();
if (rv == 0) {
printf("No Ethernet devices found\n");
return -ENODEV;
}
if (bootdev->boot_device_name)
- setenv("ethact", bootdev->boot_device_name);
+ env_set("ethact", bootdev->boot_device_name);
rv = net_loop(BOOTP);
if (rv < 0) {
printf("Problem booting with BOOTP\n");
diff --git a/common/update.c b/common/update.c
index 0767fcbcb5..061a5541b1 100644
--- a/common/update.c
+++ b/common/update.c
@@ -67,7 +67,7 @@ static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr)
tftp_timeout_count_max = cnt_max;
/* we don't want to retry the connection if errors occur */
- setenv("netretry", "no");
+ env_set("netretry", "no");
/* download the update file */
load_addr = addr;
@@ -83,7 +83,7 @@ static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr)
tftp_timeout_ms = saved_timeout_msecs;
tftp_timeout_count_max = saved_timeout_count;
- setenv("netretry", saved_netretry);
+ env_set("netretry", saved_netretry);
if (saved_netretry != NULL)
free(saved_netretry);