
From: Simon Glass <sjg@chromium.org> This function is named a bit vaguely, since it prints some info and then does verification of the image. Rename it to print_and_verify() and move the call to select_image(). Signed-off-by: Simon Glass <sjg@chromium.org> --- (no changes since v1) boot/image-fit.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/boot/image-fit.c b/boot/image-fit.c index a86dc721348..f8e13d524de 100644 --- a/boot/image-fit.c +++ b/boot/image-fit.c @@ -1973,7 +1973,7 @@ int fit_get_data_conf_prop(const void *fit, const char *prop_name, return fit_get_data_tail(fit, noffset, data, size); } -static int fit_image_select(const void *fit, int rd_noffset, int verify) +static int print_and_verify(const void *fit, int rd_noffset, int verify) { fit_image_print(fit, rd_noffset, " "); @@ -2149,6 +2149,11 @@ static int select_image(const void *fit, struct bootm_headers *images, } printf(" Trying '%s' %s subimage\n", *fit_unamep, prop_name); + ret = print_and_verify(fit, noffset, images->verify); + if (ret) { + bootstage_error(bootstage_id + BOOTSTAGE_SUB_HASH); + return ret; + } return noffset; } @@ -2171,7 +2176,6 @@ int fit_image_load(struct bootm_headers *images, ulong addr, ulong load, load_end, data, len; uint8_t os, comp; const char *prop_name; - int ret; fit = map_sysmem(addr, 0); prop_name = fit_get_image_type_property(ph_type); @@ -2186,12 +2190,6 @@ int fit_image_load(struct bootm_headers *images, ulong addr, if (noffset < 0) return noffset; - ret = fit_image_select(fit, noffset, images->verify); - if (ret) { - bootstage_error(bootstage_id + BOOTSTAGE_SUB_HASH); - return ret; - } - bootstage_mark(bootstage_id + BOOTSTAGE_SUB_CHECK_ARCH); if (!tools_build() && IS_ENABLED(CONFIG_SANDBOX)) { if (!fit_image_check_target_arch(fit, noffset)) { -- 2.43.0