From 00caae6d47645e68d6e5277aceb69592b49381a6 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Aug 2017 12:22:12 -0600 Subject: 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 Signed-off-by: Simon Glass --- drivers/usb/gadget/ether.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/usb/gadget/ether.c') diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index d0105372cf..2cf5c8d31e 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -2384,12 +2384,12 @@ static int _usb_eth_init(struct ether_priv *priv) strlcpy(host_addr, CONFIG_USBNET_HOST_ADDR, sizeof(host_addr)); #endif /* Check if the user overruled the MAC addresses */ - if (getenv("usbnet_devaddr")) - strlcpy(dev_addr, getenv("usbnet_devaddr"), + if (env_get("usbnet_devaddr")) + strlcpy(dev_addr, env_get("usbnet_devaddr"), sizeof(dev_addr)); - if (getenv("usbnet_hostaddr")) - strlcpy(host_addr, getenv("usbnet_hostaddr"), + if (env_get("usbnet_hostaddr")) + strlcpy(host_addr, env_get("usbnet_hostaddr"), sizeof(host_addr)); if (!is_eth_addr_valid(dev_addr)) { @@ -2420,8 +2420,8 @@ static int _usb_eth_init(struct ether_priv *priv) gadget = dev->gadget; usb_gadget_connect(gadget); - if (getenv("cdc_connect_timeout")) - timeout = simple_strtoul(getenv("cdc_connect_timeout"), + if (env_get("cdc_connect_timeout")) + timeout = simple_strtoul(env_get("cdc_connect_timeout"), NULL, 10) * CONFIG_SYS_HZ; ts = get_timer(0); while (!dev->network_started) { -- cgit