From d04835e1f7561ac2e8483a0e9f51a8d99bc6cd30 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Wed, 20 Oct 2021 19:37:15 +0200 Subject: [PATCH] cpu/x86/mp_init: use cb_err as install_relocation_handler return type Using cb_err as return type clarifies the meaning of the different return values. Signed-off-by: Felix Held Change-Id: I95f36ba628c7f3ce960a8f3bda730d1c720253cc Reviewed-on: https://review.coreboot.org/c/coreboot/+/58485 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans --- src/cpu/x86/mp_init.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index 89030f4575..4e90d9e37a 100644 --- a/src/cpu/x86/mp_init.c +++ b/src/cpu/x86/mp_init.c @@ -761,7 +761,7 @@ static void adjust_smm_apic_id_map(struct smm_loader_params *smm_params) stub_params->apic_id_to_cpu[i] = cpu_get_apic_id(i); } -static int install_relocation_handler(int num_cpus, size_t real_save_state_size, +static enum cb_err install_relocation_handler(int num_cpus, size_t real_save_state_size, size_t save_state_size, uintptr_t perm_smbase) { struct smm_loader_params smm_params = { @@ -779,13 +779,13 @@ static int install_relocation_handler(int num_cpus, size_t real_save_state_size, if (smm_setup_relocation_handler((void *)perm_smbase, &smm_params)) { printk(BIOS_ERR, "%s: smm setup failed\n", __func__); - return -1; + return CB_ERR; } adjust_smm_apic_id_map(&smm_params); mp_state.reloc_start32_offset = smm_params.stub_params->start32_offset; - return 0; + return CB_SUCCESS; } static int install_permanent_handler(int num_cpus, uintptr_t smbase, @@ -833,7 +833,8 @@ static void load_smm_handlers(void) /* Install handlers. */ if (install_relocation_handler(mp_state.cpu_count, real_save_state_size, - smm_save_state_size, mp_state.perm_smbase) < 0) { + smm_save_state_size, mp_state.perm_smbase) != + CB_SUCCESS) { printk(BIOS_ERR, "Unable to install SMM relocation handler.\n"); smm_disable(); }