* [U-Boot] [PATCH] image.h: Tighten up content using handy CONFIG_IS_ENABLED() macro.
@ 2016-05-21 9:06 Robert P. J. Day
2016-05-30 18:06 ` [U-Boot] " Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Robert P. J. Day @ 2016-05-21 9:06 UTC (permalink / raw)
To: u-boot
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
---
figured that if there's a handy macro for this, might as well use
it to make the header file easier to read. compile-tested building for
sandbox on x86_64. did i do anything obviously silly?
diff --git a/include/image.h b/include/image.h
index f9ee564..9e7a96e 100644
--- a/include/image.h
+++ b/include/image.h
@@ -53,18 +53,10 @@ struct lmb;
#include <libfdt.h>
#include <fdt_support.h>
# 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 */
@@ -76,52 +68,17 @@ struct lmb;
# 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
+# ifdef CONFIG_FIT_DISABLE_SHA256
+# undef CONFIG_SHA256
+# undef IMAGE_ENABLE_SHA256
+# 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
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] image.h: Tighten up content using handy CONFIG_IS_ENABLED() macro.
2016-05-21 9:06 [U-Boot] [PATCH] image.h: Tighten up content using handy CONFIG_IS_ENABLED() macro Robert P. J. Day
@ 2016-05-30 18:06 ` Tom Rini
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2016-05-30 18:06 UTC (permalink / raw)
To: u-boot
On Sat, May 21, 2016 at 05:06:31AM -0400, Robert P. J. Day wrote:
> Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160530/ce892549/attachment.sig>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-30 18:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-21 9:06 [U-Boot] [PATCH] image.h: Tighten up content using handy CONFIG_IS_ENABLED() macro Robert P. J. Day
2016-05-30 18:06 ` [U-Boot] " Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.