
21 Jan
2021
21 Jan
'21
7:37 a.m.
On Thu, Jan 21, 2021 at 10:07 AM Simon Glass sjg@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@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@gmail.com