Attention is currently required from: Jérémy Compostella.
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/79835?usp=email )
Change subject: cpu/x86/smi_trigger: use enum cb_err as apm_control return type ......................................................................
cpu/x86/smi_trigger: use enum cb_err as apm_control return type
Even though the return value from apm_control isn't checked at any of its call sites, using the cb_err enum instead of an integer as return type makes it clearer what the returned value means.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: I07ced74cae915df52a9d439835b84237d51fdd11 --- M src/cpu/x86/smi_trigger.c M src/include/cpu/x86/smm.h 2 files changed, 4 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/79835/1
diff --git a/src/cpu/x86/smi_trigger.c b/src/cpu/x86/smi_trigger.c index 9781642..5c63b9e 100644 --- a/src/cpu/x86/smi_trigger.c +++ b/src/cpu/x86/smi_trigger.c @@ -29,11 +29,11 @@ } }
-int apm_control(u8 cmd) +enum cb_err apm_control(u8 cmd) { /* Never proceed inside SMI handler or without one. */ if (ENV_SMM || !CONFIG(HAVE_SMI_HANDLER)) - return -1; + return CB_ERR;
apmc_log(__func__, cmd);
@@ -41,7 +41,7 @@ outb(cmd, pm_acpi_smi_cmd_port());
printk(BIOS_DEBUG, "APMC done.\n"); - return 0; + return CB_SUCCESS; }
u8 apm_get_apmc(void) diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h index a240ac2..dfb27cd 100644 --- a/src/include/cpu/x86/smm.h +++ b/src/include/cpu/x86/smm.h @@ -43,7 +43,7 @@ #endif
/* Send cmd to APM_CNT with HAVE_SMI_HANDLER checking. */ -int apm_control(u8 cmd); +enum cb_err apm_control(u8 cmd); u8 apm_get_apmc(void);
void io_trap_handler(int smif);