]> git.sur5r.net Git - u-boot/commitdiff
image.h: Tighten up content using handy CONFIG_IS_ENABLED() macro.
authorRobert P. J. Day <rpjday@crashcourse.ca>
Sat, 21 May 2016 09:06:31 +0000 (05:06 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 27 May 2016 19:47:55 +0000 (15:47 -0400)
In order for CONFIG_IS_ENABLED(FOO) to work we need to move the changes
that CONFIG_FIT_DISABLE_SHA256 makes to be prior to the evaluation by
CONFIG_IS_ENABLED(foo)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
[trini: Move CONFIG_FIT_DISABLE_SHA256 parts to fix build breakage]
Signed-off-by: Tom Rini <trini@konsulko.com>
include/image.h

index a8f6bd16f69c62548ebc293cf426e15d01773435..80a445408c26c10c45104a7a8bb9e14ff0e7d328 100644 (file)
@@ -52,19 +52,15 @@ struct lmb;
 #include <hash.h>
 #include <libfdt.h>
 #include <fdt_support.h>
+# ifdef CONFIG_FIT_DISABLE_SHA256
+#  undef CONFIG_SHA256
+#  undef IMAGE_ENABLE_SHA256
+# endif
 # ifdef CONFIG_SPL_BUILD
-#  ifdef CONFIG_SPL_CRC32_SUPPORT
-#   define IMAGE_ENABLE_CRC32  1
-#  endif
-#  ifdef CONFIG_SPL_MD5_SUPPORT
-#   define IMAGE_ENABLE_MD5    1
-#  endif
-#  ifdef CONFIG_SPL_SHA1_SUPPORT
-#   define IMAGE_ENABLE_SHA1   1
-#  endif
-#  ifdef CONFIG_SPL_SHA256_SUPPORT
-#   define IMAGE_ENABLE_SHA256 1
-#  endif
+#  define IMAGE_ENABLE_CRC32   CONFIG_IS_ENABLED(SPL_CRC32_SUPPORT)
+#  define IMAGE_ENABLE_MD5     CONFIG_IS_ENABLED(SPL_MD5_SUPPORT)
+#  define IMAGE_ENABLE_SHA1    CONFIG_IS_ENABLED(SPL_SHA1_SUPPORT)
+#  define IMAGE_ENABLE_SHA256  CONFIG_IS_ENABLED(SPL_SHA256_SUPPORT)
 # else
 #  define CONFIG_CRC32         /* FIT images need CRC32 support */
 #  define CONFIG_MD5           /* and MD5 */
@@ -75,53 +71,12 @@ struct lmb;
 #  define IMAGE_ENABLE_SHA1    1
 #  define IMAGE_ENABLE_SHA256  1
 # endif
-
-#ifdef CONFIG_FIT_DISABLE_SHA256
-#undef CONFIG_SHA256
-#undef IMAGE_ENABLE_SHA256
-#endif
-
-#ifndef IMAGE_ENABLE_CRC32
-#define IMAGE_ENABLE_CRC32     0
-#endif
-
-#ifndef IMAGE_ENABLE_MD5
-#define IMAGE_ENABLE_MD5       0
-#endif
-
-#ifndef IMAGE_ENABLE_SHA1
-#define IMAGE_ENABLE_SHA1      0
-#endif
-
-#ifndef IMAGE_ENABLE_SHA256
-#define IMAGE_ENABLE_SHA256    0
-#endif
-
 #endif /* IMAGE_ENABLE_FIT */
 
-#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
-# define IMAGE_ENABLE_RAMDISK_HIGH     1
-#else
-# define IMAGE_ENABLE_RAMDISK_HIGH     0
-#endif
-
-#ifdef CONFIG_SYS_BOOT_GET_CMDLINE
-# define IMAGE_BOOT_GET_CMDLINE                1
-#else
-# define IMAGE_BOOT_GET_CMDLINE                0
-#endif
-
-#ifdef CONFIG_OF_BOARD_SETUP
-# define IMAGE_OF_BOARD_SETUP          1
-#else
-# define IMAGE_OF_BOARD_SETUP          0
-#endif
-
-#ifdef CONFIG_OF_SYSTEM_SETUP
-# define IMAGE_OF_SYSTEM_SETUP 1
-#else
-# define IMAGE_OF_SYSTEM_SETUP 0
-#endif
+#define IMAGE_ENABLE_RAMDISK_HIGH      CONFIG_IS_ENABLED(SYS_BOOT_RAMDISK_HIGH)
+#define IMAGE_BOOT_GET_CMDLINE         CONFIG_IS_ENABLED(SYS_BOOT_GET_CMDLINE)
+#define IMAGE_OF_BOARD_SETUP           CONFIG_IS_ENABLED(OF_BOARD_SETUP)
+#define IMAGE_OF_SYSTEM_SETUP          CONFIG_IS_ENABLED(OF_SYSTEM_SETUP)
 
 /*
  * Operating System Codes