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

Marek Vasut marex at denx.de
Sat Jan 5 09:10:44 CET 2013


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 at 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 at denx.de>

Best regards,
Marek Vasut


More information about the U-Boot mailing list