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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/79835 Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <ericllai@google.com> Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
This commit is contained in:
parent
c4e14c2929
commit
21710ea3cd
|
@ -29,11 +29,11 @@ static void apmc_log(const char *fn, u8 cmd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int apm_control(u8 cmd)
|
enum cb_err apm_control(u8 cmd)
|
||||||
{
|
{
|
||||||
/* Never proceed inside SMI handler or without one. */
|
/* Never proceed inside SMI handler or without one. */
|
||||||
if (ENV_SMM || !CONFIG(HAVE_SMI_HANDLER))
|
if (ENV_SMM || !CONFIG(HAVE_SMI_HANDLER))
|
||||||
return -1;
|
return CB_ERR;
|
||||||
|
|
||||||
apmc_log(__func__, cmd);
|
apmc_log(__func__, cmd);
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ int apm_control(u8 cmd)
|
||||||
outb(cmd, pm_acpi_smi_cmd_port());
|
outb(cmd, pm_acpi_smi_cmd_port());
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "APMC done.\n");
|
printk(BIOS_DEBUG, "APMC done.\n");
|
||||||
return 0;
|
return CB_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 apm_get_apmc(void)
|
u8 apm_get_apmc(void)
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Send cmd to APM_CNT with HAVE_SMI_HANDLER checking. */
|
/* 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);
|
u8 apm_get_apmc(void);
|
||||||
|
|
||||||
void io_trap_handler(int smif);
|
void io_trap_handler(int smif);
|
||||||
|
|
Loading…
Reference in New Issue