diff options
author | Angel Pons <th3fanbus@gmail.com> | 2021-06-28 17:29:11 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-07-01 07:37:41 +0000 |
commit | b977c1ade30e8d3d3301f186f91c8646675dd889 (patch) | |
tree | 02c5ee706c0b26a46477851066f0f7a22149c897 /src/arch/x86/smbios.c | |
parent | d62a5012d6e5904279eb56507bc2a021d2acce77 (diff) |
arch/x86/smbios.c Move calculation next to usage
Change-Id: I949da86605e76b186ef2fdbfbc112b71544b694a
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55908
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/arch/x86/smbios.c')
-rw-r--r-- | src/arch/x86/smbios.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 8e780fd088..96b57896d4 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -635,7 +635,6 @@ static int smbios_write_type4(unsigned long *current, int handle) t->serial_number = smbios_add_string(t->eos, smbios_processor_serial_number()); t->status = SMBIOS_PROCESSOR_STATUS_CPU_ENABLED | SMBIOS_PROCESSOR_STATUS_POPULATED; t->processor_upgrade = get_socket_type(); - const int len = t->length + smbios_string_table_len(t->eos); if (cpu_have_cpuid() && cpuid_get_max_func() >= 0x16) { t->current_speed = cpuid_eax(0x16); /* base frequency */ t->external_clock = cpuid_ecx(0x16); @@ -668,6 +667,7 @@ static int smbios_write_type4(unsigned long *current, int handle) if (cpu_voltage > 0) t->voltage = 0x80 | cpu_voltage; + const int len = t->length + smbios_string_table_len(t->eos); *current += len; return len; } |