aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/lib/fsp2/fsp_dram.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-07-09 18:43:16 -0600
committerBin Meng <bmeng.cn@gmail.com>2020-07-17 14:32:24 +0800
commitef5f5f6ca691ac0b08dfae45f8723668a9fc46b6 (patch)
tree510738a8a2f0665bdb0ef9dd61faee9c5f3b16e0 /arch/x86/lib/fsp2/fsp_dram.c
parentd450ce10cc7527c651c7d81b87cb82f1f37416c9 (diff)
x86: Avoid #ifdef with CONFIG_HAVE_ACPI_RESUME
At present this enables a few arch-specific members of the global_data struct which are otherwise not part of the struct. As a result we have to use #ifdef in various places. The cost of always having these in the struct is small. Adjust things so that we can use compile-time code instead of #ifdefs. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/lib/fsp2/fsp_dram.c')
-rw-r--r--arch/x86/lib/fsp2/fsp_dram.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/lib/fsp2/fsp_dram.c b/arch/x86/lib/fsp2/fsp_dram.c
index 1c82b81831..c9f6402e6a 100644
--- a/arch/x86/lib/fsp2/fsp_dram.c
+++ b/arch/x86/lib/fsp2/fsp_dram.c
@@ -27,11 +27,10 @@ int dram_init(void)
return 0;
}
if (spl_phase() == PHASE_SPL) {
-#ifdef CONFIG_HAVE_ACPI_RESUME
- bool s3wake = gd->arch.prev_sleep_state == ACPI_S3;
-#else
bool s3wake = false;
-#endif
+
+ s3wake = IS_ENABLED(CONFIG_HAVE_ACPI_RESUME) &&
+ gd->arch.prev_sleep_state == ACPI_S3;
ret = fsp_memory_init(s3wake,
IS_ENABLED(CONFIG_APL_BOOT_FROM_FAST_SPI_FLASH));