]> git.sur5r.net Git - u-boot/commitdiff
tools: fix env_flags build
authorLubomir Rintel <lkundrak@v3.sk>
Sun, 14 Feb 2016 19:13:24 +0000 (20:13 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 15 Feb 2016 20:58:25 +0000 (20:58 +0000)
$ make tools-all
  ...
  In file included from tools/env/env_flags.c:1:0:
  tools/env/../../common/env_flags.c: In function
    ‘env_flags_parse_varaccess_from_binflags’:
    tools/env/../../common/env_flags.c:156:18: warning: implicit declaration
    of function ‘ARRAY_SIZE’ [-Wimplicit-function-declaration]
      for (i = 0; i < ARRAY_SIZE(env_flags_varaccess_mask); i++)
                      ^
Seems like the other utilities just add a copy of ARRAY_SIZE since
there's nowhere to include it from (tools/imagetool.h,
tools/mxsimage.h). Let's do the same here.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
common/env_flags.c

index 735bba5f8b614592b10847d1c0359ebf961a47db..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>