[U-Boot] [RFC PATCH 12/44] image: Move hash checking into its own functions

Marek Vasut
2013-01-05T08:10:44Z

Dear Simon Glass,

> 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>
> ---
> common/image-fit.c | 128
> ++++++++++++++++++++++++++++------------------------ 1 files changed, 69
> insertions(+), 59 deletions(-)
>
> diff --git a/common/image-fit.c b/common/image-fit.c
> index 7fab682..4a78a5c 100644
> --- a/common/image-fit.c
> +++ b/common/image-fit.c
> @@ -852,6 +852,60 @@ int calculate_hash(const void *data, int data_len,
> const char *algo, return 0;
> }
>
> +static int fit_image_check_hash(const void *fit, int noffset, const void
> *data, + size_t size, char **err_msgp)
> +{
> + uint8_t value[FIT_MAX_HASH_LEN];
> + int value_len;
> + char *algo;
> + uint8_t *fit_value;
> + int fit_value_len;
> +#ifndef USE_HOSTCC
> + int ignore;
> +#endif

You can fix this with __maybe_unused, but otherwise

Reviewed-by: Marek Vasut <marex@denx.de>

Best regards,
Marek Vasut