[PATCH 3/5] env: make env_set_default_vars() return void

Rasmus Villemoes rasmus.villemoes at prevas.dk
Tue Nov 10 21:26:01 CET 2020


Unlike most other functions declared in env.h, the return value of
this one also isn't documented. It only has a single caller, which
ignores the return value. And the companion, env_set_default(),
already has void as return type.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
---
 env/common.c  | 4 ++--
 include/env.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/env/common.c b/env/common.c
index 6c32a9b479..7363da849b 100644
--- a/env/common.c
+++ b/env/common.c
@@ -94,14 +94,14 @@ void env_set_default(const char *s, int flags)
 
 
 /* [re]set individual variables to their value in the default environment */
-int env_set_default_vars(int nvars, char * const vars[], int flags)
+void env_set_default_vars(int nvars, char * const vars[], int flags)
 {
 	/*
 	 * Special use-case: import from default environment
 	 * (and use \0 as a separator)
 	 */
 	flags |= H_NOCLEAR | H_DEFAULT;
-	return himport_r(&env_htab, (const char *)default_environment,
+	himport_r(&env_htab, (const char *)default_environment,
 				sizeof(default_environment), '\0',
 				flags, 0, nvars, vars);
 }
diff --git a/include/env.h b/include/env.h
index c15339a93f..5bff6c4d72 100644
--- a/include/env.h
+++ b/include/env.h
@@ -256,7 +256,7 @@ void env_fix_drivers(void);
  * @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);
+void env_set_default_vars(int nvars, char *const vars[], int flags);
 
 /**
  * env_load() - Load the environment from storage
-- 
2.23.0



More information about the U-Boot mailing list