[U-Boot] [PATCH v3 04/24] env: common: Make env_get_addr/get_char_memory() static

Simon Glass sjg at chromium.org
Wed Jul 26 17:19:28 UTC 2017


These functions are not used outside this file. Make them static and order
them to avoid forward declarations.

Signed-off-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Tom Rini <trini at konsulko.com>
---

Changes in v3: None
Changes in v2: None

 env/common.c          | 18 +++++++++---------
 include/environment.h |  4 ----
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/env/common.c b/env/common.c
index d9c0c4e3f3..5a17e52615 100644
--- a/env/common.c
+++ b/env/common.c
@@ -41,7 +41,15 @@ static uchar env_get_char_init(int index)
 		return default_environment[index];
 }
 
-uchar env_get_char_memory(int index)
+static const uchar *env_get_addr(int index)
+{
+	if (gd->env_valid)
+		return (uchar *)(gd->env_addr + index);
+	else
+		return &default_environment[index];
+}
+
+static uchar env_get_char_memory(int index)
 {
 	return *env_get_addr(index);
 }
@@ -55,14 +63,6 @@ uchar env_get_char(int index)
 		return env_get_char_init(index);
 }
 
-const uchar *env_get_addr(int index)
-{
-	if (gd->env_valid)
-		return (uchar *)(gd->env_addr + index);
-	else
-		return &default_environment[index];
-}
-
 /*
  * Read an environment variable as a boolean
  * Return -1 if variable does not exist (default to true)
diff --git a/include/environment.h b/include/environment.h
index d86230a2e9..5f2064bf23 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -202,10 +202,6 @@ extern struct hsearch_data env_htab;
 /* Function that returns a character from the environment */
 unsigned char env_get_char(int);
 
-/* Function that returns a pointer to a value from the environment */
-const unsigned char *env_get_addr(int);
-unsigned char env_get_char_memory(int index);
-
 /* Function that updates CRC of the enironment */
 void env_crc_update(void);
 
-- 
2.14.0.rc0.400.g1c36432dff-goog



More information about the U-Boot mailing list