SMBIOS: Introduce smbios_full_table_len
function
Introduce the `smbios_full_table_len` function to consolidate table length calculation. The case where the length of a table equals the length of the structure happens when a table has no strings. Change-Id: Ibc60075e82eb66b5d0b7132b16da000b153413f9 Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/55909 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
This commit is contained in:
committed by
Patrick Georgi
parent
b977c1ade3
commit
a37701afa3
@ -28,7 +28,7 @@ static int smbios_write_intel_wifi(struct device *dev, int *handle, unsigned lon
|
||||
/* Intel wifi driver expects this string to be in the table 0x85. */
|
||||
t->str = smbios_add_string(t->eos, "KHOIHGIUCCHHII");
|
||||
|
||||
const int len = t->length + smbios_string_table_len(t->eos);
|
||||
const int len = smbios_full_table_len(&t->header, t->eos);
|
||||
*current += len;
|
||||
*handle += 1;
|
||||
return len;
|
||||
|
Reference in New Issue
Block a user