From 9db0a2dcc8925d1680a5bf223c589ff2db9eca28 Mon Sep 17 00:00:00 2001 From: Marshall Dawson Date: Fri, 22 Sep 2017 15:35:32 -0600 Subject: amd/stoneyridge: Clean up smi_util.c Replace hardcoded values with defined ones. Change-Id: If963a817a4bea9b6dbb0d41a2bc0789a44a01391 Signed-off-by: Marshall Dawson Reviewed-on: https://review.coreboot.org/21743 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Martin Roth Reviewed-by: Marc Jones --- src/soc/amd/stoneyridge/smi_util.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/soc/amd/stoneyridge') diff --git a/src/soc/amd/stoneyridge/smi_util.c b/src/soc/amd/stoneyridge/smi_util.c index 822738ca27..68e792c710 100644 --- a/src/soc/amd/stoneyridge/smi_util.c +++ b/src/soc/amd/stoneyridge/smi_util.c @@ -8,15 +8,12 @@ #include #include -#define STONEYRIDGE_SMI_ACPI_COMMAND 75 - static void configure_smi(uint8_t smi_num, uint8_t mode) { uint8_t reg32_offset, bit_offset; uint32_t reg32; - /* SMI sources range from [0:149] */ - if (smi_num > 149) { + if (smi_num >= NUMBER_SMITYPES) { printk(BIOS_WARNING, "BUG: Invalid SMI: %u\n", smi_num); return; } @@ -74,5 +71,5 @@ void disable_gevent_smi(uint8_t gevent) /** Enable SMIs on writes to ACPI SMI command port */ void enable_acpi_cmd_smi(void) { - configure_smi(STONEYRIDGE_SMI_ACPI_COMMAND, SMI_MODE_SMI); + configure_smi(SMITYPE_SMI_CMD_PORT, SMI_MODE_SMI); } -- cgit v1.2.3