]> git.sur5r.net Git - u-boot/blobdiff - common/hwconfig.c
env: Rename setenv() to env_set()
[u-boot] / common / hwconfig.c
index 515074808ddada52371ad8329970d005a8d72795..85aaabbb85529eb9413cc6548848e9f402eb0cfb 100644 (file)
@@ -6,10 +6,7 @@
  *
  * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #ifndef HWCONFIG_TEST
@@ -81,8 +78,8 @@ static const char *__hwconfig(const char *opt, size_t *arglen,
        if (!env_hwconfig) {
                if (!(gd->flags & GD_FLG_ENV_READY)) {
                        printf("WARNING: Calling __hwconfig without a buffer "
-                                       "and before environment is ready\n"); 
-                       return NULL; 
+                                       "and before environment is ready\n");
+                       return NULL;
                }
                env_hwconfig = getenv("hwconfig");
        }
@@ -246,7 +243,7 @@ int main()
        const char *ret;
        size_t len;
 
-       setenv("hwconfig", "key1:subkey1=value1,subkey2=value2;key2:value3;;;;"
+       env_set("hwconfig", "key1:subkey1=value1,subkey2=value2;key2:value3;;;;"
                           "key3;:,:=;key4", 1);
 
        ret = hwconfig_arg("key1", &len);
@@ -277,7 +274,7 @@ int main()
        assert(hwconfig_arg("key4", &len) == NULL);
        assert(hwconfig_arg("bogus", &len) == NULL);
 
-       unsetenv("hwconfig");
+       unenv_set("hwconfig");
 
        assert(hwconfig(NULL) == 0);
        assert(hwconfig("") == 0);