Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44021 )
Change subject: arch/x86/smbios.c: Simplify assignment ......................................................................
arch/x86/smbios.c: Simplify assignment
We can reduce the amount of duplicated code with a ternary operator.
Change-Id: I8be95a62c54749d39e3e8821abd46d9f467a5a49 Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/arch/x86/smbios.c 1 file changed, 1 insertion(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/21/44021/1
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index a8c8772..07ccacf 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -983,10 +983,7 @@ t->type = SMBIOS_SYSTEM_SLOTS; t->handle = *handle; t->length = len - 2; - if (name) - t->slot_designation = smbios_add_string(t->eos, name); - else - t->slot_designation = smbios_add_string(t->eos, "SLOT"); + t->slot_designation = smbios_add_string(t->eos, name ? name : "SLOT"); t->slot_type = type; /* TODO add slot_id supoort, will be "_SUN" for ACPI devices */ t->slot_data_bus_width = bandwidth;