hi Masami, On Thu, 20 Jan 2022 at 11:35, Masami Hiramatsu <masami.hirama...@linaro.org> wrote: > > Hi Sughosh, > > I have another comment on this patch. > > 2022年1月20日(木) 3:56 Sughosh Ganu <sughosh.g...@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".
Will update the check. Thanks. > > > + printf("Active index value to be updated is incorrect\n"); > > Could you use log_err() instead of printf() for error messages? Will do. -sughosh > > Thank you, > > > -- > Masami Hiramatsu