]> git.dujemihanovic.xyz Git - u-boot.git/commit
smbios: Simplify reporting of unknown values
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Thu, 7 Dec 2023 09:18:49 +0000 (11:18 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 20 Dec 2023 19:13:20 +0000 (14:13 -0500)
commita986ccea541b8e38ca219dc142f1bfef9a93ab66
treebaf18aed19533d0bb32e12ab6152959a37b63fcd
parent4268ef9282c5870aaf45375e3816d0a8c644b214
smbios: Simplify reporting of unknown values

If a value is not valid during the DT or SYSINFO parsing,  we explicitly
set that to "Unknown Product" and "Unknown" for the product and
manufacturer respectively.  It's cleaner if we move the checks insisde
smbios_add_prop_si() and provide an alternative string in case the
primary is NULL or empty

pre-patch dmidecode
<snip>
Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: Unknown
        Product Name: Unknown Product
        Version: Not Specified
        Serial Number: Not Specified
        UUID: Not Settable
        Wake-up Type: Reserved
        SKU Number: Not Specified
        Family: Not Specified

[...]

post-patch dmidecode:

Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: Unknown
        Product Name: Unknown
        Version: Unknown
        Serial Number: Unknown
        UUID: Not Settable
        Wake-up Type: Reserved
        SKU Number: Unknown
        Family: Unknown
[...]

While at it make smbios_add_prop_si() add a string directly if the prop
node is NULL and replace smbios_add_string() calls with
smbios_add_prop_si(ctx, NULL, ....)

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
lib/smbios.c