From 6a8029c2c93d51916ae9f424da2b4da38a838b75 Mon Sep 17 00:00:00 2001 From: Elyes Haouas Date: Tue, 13 Sep 2022 10:16:01 +0200 Subject: [PATCH] soc/intel/meteorlake: Use "if (!ptr)" in preference to "if (ptr == NULL)" Signed-off-by: Elyes Haouas Change-Id: Ia2508abe62a194f2921d5535937ba82a60967ca3 Reviewed-on: https://review.coreboot.org/c/coreboot/+/67612 Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik --- src/soc/intel/meteorlake/fsp_params.c | 2 +- src/soc/intel/meteorlake/romstage/romstage.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/soc/intel/meteorlake/fsp_params.c b/src/soc/intel/meteorlake/fsp_params.c index 3e8d22e15a..e3c85600a1 100644 --- a/src/soc/intel/meteorlake/fsp_params.c +++ b/src/soc/intel/meteorlake/fsp_params.c @@ -126,7 +126,7 @@ static void fill_fsps_cpu_params(FSP_S_CONFIG *s_cfg, /* Locate microcode and pass to FSP-S for 2nd microcode loading */ microcode_file = cbfs_map("cpu_microcode_blob.bin", µcode_len); - if ((microcode_file != NULL) && (microcode_len != 0)) { + if ((microcode_file) && (microcode_len != 0)) { /* Update CPU Microcode patch base address/size */ s_cfg->MicrocodeRegionBase = (uint32_t)microcode_file; s_cfg->MicrocodeRegionSize = (uint32_t)microcode_len; diff --git a/src/soc/intel/meteorlake/romstage/romstage.c b/src/soc/intel/meteorlake/romstage/romstage.c index 2ac5021b42..2d3b14415e 100644 --- a/src/soc/intel/meteorlake/romstage/romstage.c +++ b/src/soc/intel/meteorlake/romstage/romstage.c @@ -43,7 +43,7 @@ static void save_dimm_info(void) meminfo_hob = fsp_find_extension_hob_by_guid( smbios_memory_info_guid, &hob_size); - if (meminfo_hob == NULL || hob_size == 0) { + if (!meminfo_hob || hob_size == 0) { printk(BIOS_ERR, "SMBIOS MEMORY_INFO_DATA_HOB not found\n"); return; } @@ -53,7 +53,7 @@ static void save_dimm_info(void) * table 17 */ mem_info = cbmem_add(CBMEM_ID_MEMINFO, sizeof(*mem_info)); - if (mem_info == NULL) { + if (!mem_info) { printk(BIOS_ERR, "CBMEM entry for DIMM info missing\n"); return; }