[PATCH 2/2 v3] smbios: Fallback to the default DT if sysinfo nodes are missing
Ilias Apalodimas
ilias.apalodimas at linaro.org
Wed Dec 13 22:42:35 CET 2023
Hi Simon,
[...]
>
> Can we add a Kconfig to enable this?
I don't see the point, and I am not the only one.
> > + * @size: str buffer length
[...]
> > + int cnt = 0;
> > + char *token;
> > +
> > + memset(str, 0, size);
>
> *str = '\0' should be enough, assuming size is not 0
I generally prefer initializing all memory, it's not that big of a burden here.
[...]
> > - str = ofnode_read_string(ctx->node, prop);
> > + const char *str = NULL;
> > + char str_dt[128] = { 0 };
> > + /*
> > + * If the node is not valid fallback and try the entire DT
>
> s/and/then/ ?
>
Sure
> > + * so we can at least fill in manufacturer and board type
> > + */
> > + if (ofnode_valid(ctx->node)) {
> > + str = ofnode_read_string(ctx->node, prop);
> > + } else {
> > + const struct map_sysinfo *nprop;
> > +
> > + nprop = convert_sysinfo_to_dt(prop);
> > + get_str_from_dt(nprop, str_dt, sizeof(str_dt));
> > + str = (const char *)str_dt;
>
> can't you drop the case?
What case?
[...]
Thanks
/Ilias
More information about the U-Boot
mailing list