On Mon, Nov 7, 2022 at 11:23 AM Etienne Carriere <etienne.carri...@linaro.org> wrote: > > Hello Jassi, > > FYI, I've successfully tested this series on stm32mp1 for FWU, once > the few typos fixed to build it them. > Thanks for testing. I will fix the typos and resubmit.
..... > > @@ -831,11 +662,7 @@ static int fwu_boottime_checks(void *ctx, struct event > > *event) > > if (efi_init_obj_list() != EFI_SUCCESS) > > return 0; > > > > - ret = fwu_get_dev_mdata(&dev, &mdata); > > - if (ret) > > - return ret; > > - > > - in_trial = in_trial_state(&mdata); > > + in_trial = in_trial_state(&g_mdata); > > Since g_mdata is global, in_trial_state() could access it straight > without needing to pass g_mdata as argument. > I wanted to keep changes to the minimum. Also using global variables is ugly, so I wanted to keep the g_mdata usage to minimum (only for initializing the local variable). And finally the signature in_trial_state(void) hides the fact that it works on external data - g_mdata. Cheers!