drivers/intel/fsp2_0/memory_init.c: clean code

No need to call a function that just instantly returns.
It greatly enhances readability to just check before calling a funtion
and it also removes an extra argument.

Change-Id: I4d57c45ede520160ef615725c023b7e92289a995
Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68592
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Maximilian Brune 2022-10-20 18:56:43 +02:00 committed by Felix Held
parent 0e7a52a138
commit 2f548e597b
1 changed files with 3 additions and 5 deletions

View File

@ -26,14 +26,11 @@
static uint8_t temp_ram[CONFIG_FSP_TEMP_RAM_SIZE] __aligned(sizeof(uint64_t)); static uint8_t temp_ram[CONFIG_FSP_TEMP_RAM_SIZE] __aligned(sizeof(uint64_t));
static void save_memory_training_data(bool s3wake, uint32_t fsp_version) static void save_memory_training_data(uint32_t fsp_version)
{ {
size_t mrc_data_size; size_t mrc_data_size;
const void *mrc_data; const void *mrc_data;
if (!CONFIG(CACHE_MRC_SETTINGS) || s3wake)
return;
mrc_data = fsp_find_nv_storage_data(&mrc_data_size); mrc_data = fsp_find_nv_storage_data(&mrc_data_size);
if (!mrc_data) { if (!mrc_data) {
printk(BIOS_ERR, "FSP_NON_VOLATILE_STORAGE_HOB missing!\n"); printk(BIOS_ERR, "FSP_NON_VOLATILE_STORAGE_HOB missing!\n");
@ -76,7 +73,8 @@ static void do_fsp_post_memory_init(bool s3wake, uint32_t fsp_version)
(uintptr_t)cbmem_find(CBMEM_ID_FSP_RESERVED_MEMORY)) (uintptr_t)cbmem_find(CBMEM_ID_FSP_RESERVED_MEMORY))
die("Failed to accommodate FSP reserved memory request!\n"); die("Failed to accommodate FSP reserved memory request!\n");
save_memory_training_data(s3wake, fsp_version); if (CONFIG(CACHE_MRC_SETTINGS) && !s3wake)
save_memory_training_data(fsp_version);
/* Create romstage handof information */ /* Create romstage handof information */
romstage_handoff_init(s3wake); romstage_handoff_init(s3wake);