From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Thu, 6 May 2021 08:24:18 -0600 Subject: [PATCH v2 30/50] image: Drop IMAGE_ENABLE_MD5 In-Reply-To: <20210506142438.1310977-1-sjg@chromium.org> References: <20210506142438.1310977-1-sjg@chromium.org> Message-ID: <20210506082420.v2.30.I5ba26e911d0ffff8af74ec113d11a5421b0c009f@changeid> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Add a host Kconfig for MD5. With this we can use CONFIG_IS_ENABLED(MD5) directly in the host build, so drop the unnecessary indirection. Signed-off-by: Simon Glass --- (no changes since v1) common/image-fit.c | 2 +- include/image.h | 8 -------- tools/Kconfig | 5 +++++ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/common/image-fit.c b/common/image-fit.c index 1ce46a5c72d..19a2d3c91df 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -1234,7 +1234,7 @@ int calculate_hash(const void *data, int data_len, const char *algo, sha512_csum_wd((unsigned char *)data, data_len, (unsigned char *)value, CHUNKSZ_SHA512); *value_len = SHA512_SUM_LEN; - } else if (IMAGE_ENABLE_MD5 && strcmp(algo, "md5") == 0) { + } else if (CONFIG_IS_ENABLED(MD5) && strcmp(algo, "md5") == 0) { md5_wd((unsigned char *)data, data_len, value, CHUNKSZ_MD5); *value_len = 16; } else { diff --git a/include/image.h b/include/image.h index e1e4bf6806f..9f665a597b0 100644 --- a/include/image.h +++ b/include/image.h @@ -47,21 +47,13 @@ struct fdt_region; #include #include # ifdef CONFIG_SPL_BUILD -# ifdef CONFIG_SPL_MD5 -# define IMAGE_ENABLE_MD5 1 -# endif # ifdef CONFIG_SPL_FIT_SHA1 # define IMAGE_ENABLE_SHA1 1 # endif # else -# define IMAGE_ENABLE_MD5 1 # define IMAGE_ENABLE_SHA1 1 # endif -#ifndef IMAGE_ENABLE_MD5 -#define IMAGE_ENABLE_MD5 0 -#endif - #ifndef IMAGE_ENABLE_SHA1 #define IMAGE_ENABLE_SHA1 0 #endif diff --git a/tools/Kconfig b/tools/Kconfig index e27826fae9f..bbd6e8b9d79 100644 --- a/tools/Kconfig +++ b/tools/Kconfig @@ -69,6 +69,11 @@ config HOST_FIT_VERBOSE help Support verbose FIT output in the host build +config HOST_MD5 + def_bool y + help + Enable MD5 support in the host build + config HOST_OF_LIBFDT def_bool y help -- 2.31.1.607.g51e8a6a459-goog