]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/env_flags.c
arm: dts: imx7: add basic i.MX 7/Colibri iMX7 device tree
[people/ms/u-boot.git] / common / env_flags.c
index 9c3aed15278dc2fc53ba1bc8571c7da840681731..921d3770ead5b6fb5af561c9e82744b2e31eef71 100644 (file)
@@ -15,6 +15,7 @@
 #include <env_attr.h>
 #include <env_flags.h>
 #define getenv fw_getenv
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 #else
 #include <common.h>
 #include <environment.h>
@@ -373,21 +374,21 @@ int env_flags_validate_varaccess(const char *name, int check_mask)
 /*
  * Validate the parameters to "env set" directly
  */
-int env_flags_validate_env_set_params(int argc, char * const argv[])
+int env_flags_validate_env_set_params(char *name, char * const val[], int count)
 {
-       if ((argc >= 3) && argv[2] != NULL) {
-               enum env_flags_vartype type = env_flags_get_type(argv[1]);
+       if ((count >= 1) && val[0] != NULL) {
+               enum env_flags_vartype type = env_flags_get_type(name);
 
                /*
                 * we don't currently check types that need more than
                 * one argument
                 */
-               if (type != env_flags_vartype_string && argc > 3) {
-                       printf("## Error: too many parameters for setting "
-                               "\"%s\"\n", argv[1]);
+               if (type != env_flags_vartype_string && count > 1) {
+                       printf("## Error: too many parameters for setting \"%s\"\n",
+                              name);
                        return -1;
                }
-               return env_flags_validate_type(argv[1], argv[2]);
+               return env_flags_validate_type(name, val[0]);
        }
        /* ok */
        return 0;