[PATCH v2 06/12] smbios: Use a struct to keep track of context

Bin Meng bmeng.cn at gmail.com
Thu Jan 21 07:37:43 CET 2021


On Thu, Jan 21, 2021 at 10:07 AM Simon Glass <sjg at chromium.org> wrote:
>
> At present we pass the ofnode to each function. We also pass the 'eos'
> pointer for adding new strings. We don't track the current end of the
> string table, so have smbios_string_table_len() to find that.
>
> The code can be made more efficient if it keeps information in a
> context struct. This also makes it easier to add more features.
>
> As a first step, switch the ofnode parameter to be a context pointer.
> Update smbios_add_prop() at the same time to avoid changing the same
> lines of code in consecutive patches.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> Changes in v2:
> - Zero the context's dev pointer if not used
>
>  lib/smbios.c | 87 +++++++++++++++++++++++++++++++++-------------------
>  1 file changed, 55 insertions(+), 32 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>


More information about the U-Boot mailing list