[PATCH 4/4] fwu: meta-data: switch to management by common code

Jassi Brar jassisinghbrar at gmail.com
Mon Nov 7 19:39:03 CET 2022


On Mon, Nov 7, 2022 at 11:23 AM Etienne Carriere
<etienne.carriere at 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!


More information about the U-Boot mailing list