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>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44021
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Angel Pons 2020-07-29 18:23:23 +02:00
parent bf2f91c87c
commit 3c13da7897
1 changed files with 1 additions and 4 deletions

View File

@ -983,10 +983,7 @@ int smbios_write_type9(unsigned long *current, int *handle,
t->type = SMBIOS_SYSTEM_SLOTS; t->type = SMBIOS_SYSTEM_SLOTS;
t->handle = *handle; t->handle = *handle;
t->length = len - 2; t->length = len - 2;
if (name) t->slot_designation = smbios_add_string(t->eos, name ? name : "SLOT");
t->slot_designation = smbios_add_string(t->eos, name);
else
t->slot_designation = smbios_add_string(t->eos, "SLOT");
t->slot_type = type; t->slot_type = type;
/* TODO add slot_id supoort, will be "_SUN" for ACPI devices */ /* TODO add slot_id supoort, will be "_SUN" for ACPI devices */
t->slot_data_bus_width = bandwidth; t->slot_data_bus_width = bandwidth;