diff options
author | Angel Pons <th3fanbus@gmail.com> | 2020-07-29 18:23:23 +0200 |
---|---|---|
committer | Angel Pons <th3fanbus@gmail.com> | 2020-07-30 22:47:02 +0000 |
commit | 3c13da78971183e0689475b16f05919210aea073 (patch) | |
tree | 0cf20f66d50482bda8bf6c7399c514eb08801c3f /src | |
parent | bf2f91c87c65b94f826e8b71a180ea20f10597a3 (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/x86/smbios.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index a8c8772d62..07ccacfa25 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -983,10 +983,7 @@ int smbios_write_type9(unsigned long *current, int *handle, 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; |