[PATCH v2 23/41] bootstd: Add support for bootflows

Simon Glass sjg at chromium.org
Sat Mar 12 03:24:37 CET 2022


Hi Ilias,

On Wed, 27 Oct 2021 at 01:37, Ilias Apalodimas
<ilias.apalodimas at linaro.org> wrote:
>
> Hi Simon,
>
> > +
>
> [...]
>
> > +/* error codes used to signal running out of things */
> > +enum {
> > +     BF_NO_MORE_PARTS        = -ESHUTDOWN,
> > +     BF_NO_MORE_DEVICES      = -ENODEV,
> > +};
> > +
> > +static const char *const bootflow_state[BOOTFLOWST_COUNT] = {
> > +     "base",
> > +     "media",
> > +     "part",
> > +     "fs",
> > +     "file",
> > +     "ready",
>
> I can understand 'ready' as a boot state.  What are the rest supposed to be
> ?

These are documented in the header file.

>
> > +};
> > +
> > +const char *bootflow_state_get_name(enum bootflow_state_t state)
> > +{
> > +     if (state < 0 || state >= BOOTFLOWST_COUNT)
> > +             return "?";
>
> s/?/Unknown/ or invalid maybe?

This is an invalid state so should not happen. Tom is pushing for the
minimum possible code size so it doesn't seem worth putting a
user-friendly error for a case that can't happen.


>
> > +
> > +     return bootflow_state[state];
> > +}
> > +
> > +int bootflow_first_glob(struct bootflow **bflowp)
> > +{
> > +     struct bootstd_priv *std;
>
> [...]
>
> Regards
> /Ilias


More information about the U-Boot mailing list