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 --- cmd/mtdparts.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cmd/mtdparts.c') 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(); } -- cgit v1.2.1