fdtdec: test: Fix build warning
authorThierry Reding <treding@nvidia.com>
Thu, 21 Mar 2019 18:10:05 +0000 (19:10 +0100)
committerSimon Glass <sjg@chromium.org>
Fri, 12 Apr 2019 02:10:50 +0000 (20:10 -0600)
Hide the declaration of the "fd" variable When not building a DEBUG
configuration, to avoid the variable being unused.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
lib/fdtdec_test.c

index a82e27de942f2fb3ac2bfda8943b6bf63f7f1be1..065fed278cf3d8f1919d85f423e95546675067ce 100644 (file)
@@ -79,7 +79,9 @@ static int make_fdt(void *fdt, int size, const char *aliases,
 {
        char name[20], value[20];
        const char *s;
+#if defined(DEBUG) && defined(CONFIG_SANDBOX)
        int fd;
+#endif
 
        CHECK(fdt_create(fdt, size));
        CHECK(fdt_finish_reservemap(fdt));