summaryrefslogtreecommitdiff
path: root/common/hash.c
diff options
context:
space:
mode:
authorDaniel Thompson <daniel.thompson@linaro.org>2017-05-19 16:26:58 (GMT)
committerTom Rini <trini@konsulko.com>2017-05-31 23:38:14 (GMT)
commit221a949eb6cf9077abc1e7ee28331987042b9b08 (patch)
tree09e8deca47308000f57f556d51f4faa459ba8ff3 /common/hash.c
parentccbbada0a59fead35495409d0c2c7bcb22a40278 (diff)
downloadu-boot-221a949eb6cf9077abc1e7ee28331987042b9b08.tar.xz
Kconfig: Finish migration of hashing commands
Currently these (board agnostic) commands cannot be selected using menuconfig and friends. Fix this the obvious way. As part of this, don't muddle the meaning of CONFIG_HASH_VERIFY to mean both 'hash -v' and "we have a hashing command" as this makes the Kconfig logic odd. Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> [trini: Re-apply, add imply for a few cases, run moveconfig.py, also migrate CRC32_VERIFY] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common/hash.c')
-rw-r--r--common/hash.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/common/hash.c b/common/hash.c
index a0eded9..771d8fa 100644
--- a/common/hash.c
+++ b/common/hash.c
@@ -178,16 +178,9 @@ static struct hash_algo hash_algo[] = {
},
};
-#if defined(CONFIG_SHA256) || defined(CONFIG_CMD_SHA1SUM)
-#define MULTI_HASH
-#endif
-
-#if defined(CONFIG_HASH_VERIFY) || defined(CONFIG_CMD_HASH)
-#define MULTI_HASH
-#endif
-
/* Try to minimize code size for boards that don't want much hashing */
-#ifdef MULTI_HASH
+#if defined(CONFIG_SHA256) || defined(CONFIG_CMD_SHA1SUM) || \
+ defined(CONFIG_CRC32_VERIFY) || defined(CONFIG_CMD_HASH)
#define multi_hash() 1
#else
#define multi_hash() 0
@@ -424,7 +417,8 @@ int hash_command(const char *algo_name, int flags, cmd_tbl_t *cmdtp, int flag,
unmap_sysmem(buf);
/* Try to avoid code bloat when verify is not needed */
-#ifdef CONFIG_HASH_VERIFY
+#if defined(CONFIG_CRC32_VERIFY) || defined(CONFIG_SHA1SUM_VERIFY) || \
+ defined(CONFIG_HASH_VERIFY)
if (flags & HASH_FLAG_VERIFY) {
#else
if (0) {