diff options
author | Simon Glass <sjg@chromium.org> | 2017-08-03 12:22:12 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-08-16 08:30:24 -0400 |
commit | 00caae6d47645e68d6e5277aceb69592b49381a6 (patch) | |
tree | c361aa0cea3093b93c1118266fe9e2b44ac6e453 /net/eth_common.c | |
parent | fd1e959e91d2b0b2e853d09dd9167dfff18a616c (diff) | |
download | u-boot-00caae6d47645e68d6e5277aceb69592b49381a6.tar.gz |
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 'net/eth_common.c')
-rw-r--r-- | net/eth_common.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/eth_common.c b/net/eth_common.c index 7b36532ee1..bde3b88322 100644 --- a/net/eth_common.c +++ b/net/eth_common.c @@ -26,7 +26,7 @@ void eth_parse_enetaddr(const char *addr, uchar *enetaddr) int eth_getenv_enetaddr(const char *name, uchar *enetaddr) { - eth_parse_enetaddr(getenv(name), enetaddr); + eth_parse_enetaddr(env_get(name), enetaddr); return is_valid_ethaddr(enetaddr); } @@ -76,13 +76,13 @@ int eth_mac_skip(int index) char *skip_state; sprintf(enetvar, index ? "eth%dmacskip" : "ethmacskip", index); - skip_state = getenv(enetvar); + skip_state = env_get(enetvar); return skip_state != NULL; } void eth_current_changed(void) { - char *act = getenv("ethact"); + char *act = env_get("ethact"); char *ethrotate; /* @@ -90,7 +90,7 @@ void eth_current_changed(void) * ethernet device if uc_priv->current == NULL. This is not what * we want when 'ethrotate' variable is 'no'. */ - ethrotate = getenv("ethrotate"); + ethrotate = env_get("ethrotate"); if ((ethrotate != NULL) && (strcmp(ethrotate, "no") == 0)) return; @@ -116,7 +116,7 @@ void eth_try_another(int first_restart) * Do not rotate between network interfaces when * 'ethrotate' variable is set to 'no'. */ - ethrotate = getenv("ethrotate"); + ethrotate = env_get("ethrotate"); if ((ethrotate != NULL) && (strcmp(ethrotate, "no") == 0)) return; @@ -142,12 +142,12 @@ void eth_set_current(void) env_id = get_env_id(); if ((act == NULL) || (env_changed_id != env_id)) { - act = getenv("ethact"); + act = env_get("ethact"); env_changed_id = env_id; } if (act == NULL) { - char *ethprime = getenv("ethprime"); + char *ethprime = env_get("ethprime"); void *dev = NULL; if (ethprime) |