[RFC PATCH v3 1/9] FWU: Add FWU metadata structure and functions for accessing metadata
Masami Hiramatsu
masami.hiramatsu at linaro.org
Thu Jan 20 07:05:45 CET 2022
Hi Sughosh,
I have another comment on this patch.
2022年1月20日(木) 3:56 Sughosh Ganu <sughosh.ganu at linaro.org>:
> +/**
> + * fwu_update_active_index() - Update active_index from the FWU metadata
> + * @active_idx: active_index value to be updated
> + *
> + * Update the active_index field in the FWU metadata
> + *
> + * Return: 0 if OK, -ve on error
> + *
> + */
> +int fwu_update_active_index(u32 active_idx)
> +{
> + int ret;
> + void *buf;
> + struct fwu_mdata *mdata = NULL;
> +
> + if (active_idx > CONFIG_FWU_NUM_BANKS) {
Since active_index must be 0 .. CONFIG_FWU_NUM_BANKS - 1, it should
cap the new active_index with "CONFIG_FWU_NUM_BANKS - 1" instead of
"CONFIG_FWU_NUM_BANKS".
> + printf("Active index value to be updated is incorrect\n");
Could you use log_err() instead of printf() for error messages?
Thank you,
--
Masami Hiramatsu
More information about the U-Boot
mailing list