[U-Boot] [PATCH 20/39] env: Move set_default_vars to env.h

Simon Glass sjg at chromium.org
Sun Jul 28 14:03:37 UTC 2019


Move this function to the new header file and rename it so it has an env_
prefix.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 cmd/nvedit.c          |  2 +-
 env/common.c          |  2 +-
 include/env.h         | 11 +++++++++++
 include/environment.h |  3 ---
 4 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 751b77d0e9..390d040de3 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -832,7 +832,7 @@ static int do_env_default(cmd_tbl_t *cmdtp, int flag,
 	}
 	if (!all && (argc > 0)) {
 		/* Reset individual variables */
-		set_default_vars(argc, argv, env_flag);
+		env_set_default_vars(argc, argv, env_flag);
 		return 0;
 	}
 
diff --git a/env/common.c b/env/common.c
index 1fbc4a874d..db2a033f68 100644
--- a/env/common.c
+++ b/env/common.c
@@ -92,7 +92,7 @@ void set_default_env(const char *s, int flags)
 
 
 /* [re]set individual variables to their value in the default environment */
-int set_default_vars(int nvars, char * const vars[], int flags)
+int env_set_default_vars(int nvars, char * const vars[], int flags)
 {
 	/*
 	 * Special use-case: import from default environment
diff --git a/include/env.h b/include/env.h
index 924b327c44..5c01cd3d6d 100644
--- a/include/env.h
+++ b/include/env.h
@@ -198,4 +198,15 @@ void eth_parse_enetaddr(const char *addr, uint8_t *enetaddr);
  */
 void env_fix_drivers(void);
 
+/**
+ * env_set_default_vars() - reset variables to their default value
+ *
+ * This resets individual variables to their value in the default environment
+ *
+ * @nvars: Number of variables to set/reset
+ * @vars: List of variables to set/reset
+ * @flags: Flags controlling matching (H_... - see search.h)
+ */
+int env_set_default_vars(int nvars, char *const vars[], int flags);
+
 #endif
diff --git a/include/environment.h b/include/environment.h
index 7be1ef98ad..97d4886599 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -274,9 +274,6 @@ char *env_get_default(const char *name);
 /* [re]set to the default environment */
 void set_default_env(const char *s, int flags);
 
-/* [re]set individual variables to their value in the default environment */
-int set_default_vars(int nvars, char * const vars[], int flags);
-
 /* Import from binary representation into hash table */
 int env_import(const char *buf, int check);
 
-- 
2.22.0.709.g102302147b-goog



More information about the U-Boot mailing list