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)
This commit is contained in:
Simon Glass
2013-05-07 06:11:58 +00:00
committed by Tom Rini
parent b8da836650
commit ab9efc665a
2 changed files with 71 additions and 65 deletions

View File

@@ -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_get_data(const void *fit, int noffset,
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);