image: Move hash checking into its own function
The existing function is long and most of the code is indented a long
way. Before adding yet more code, split this out into its own function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de> (v1)
diff --git a/include/image.h b/include/image.h
index 59e8064..507ce42 100644
--- a/include/image.h
+++ b/include/image.h
@@ -43,12 +43,17 @@
#define CONFIG_OF_LIBFDT 1
#define CONFIG_FIT_VERBOSE 1 /* enable fit_format_{error,warning}() */
+#define IMAGE_ENABLE_IGNORE 0
+
#else
#include <lmb.h>
#include <asm/u-boot.h>
#include <command.h>
+/* Take notice of the 'ignore' property for hashes */
+#define IMAGE_ENABLE_IGNORE 1
+
#endif /* USE_HOSTCC */
#if defined(CONFIG_FIT)
@@ -607,9 +612,6 @@
int fit_image_hash_get_algo(const void *fit, int noffset, char **algo);
int fit_image_hash_get_value(const void *fit, int noffset, uint8_t **value,
int *value_len);
-#ifndef USE_HOSTCC
-int fit_image_hash_get_ignore(const void *fit, int noffset, int *ignore);
-#endif
int fit_set_timestamp(void *fit, int noffset, time_t timestamp);
int fit_set_hashes(void *fit);