soc/intel/meteorlake: Use "if (!ptr)" in preference to "if (ptr == NULL)"

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Change-Id: Ia2508abe62a194f2921d5535937ba82a60967ca3
Reviewed-on: https://review.coreboot.org/c/coreboot/+/67612
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
This commit is contained in:
Elyes Haouas 2022-09-13 10:16:01 +02:00 committed by Felix Held
parent aebccac7e1
commit 6a8029c2c9
2 changed files with 3 additions and 3 deletions

View File

@ -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 */ /* Locate microcode and pass to FSP-S for 2nd microcode loading */
microcode_file = cbfs_map("cpu_microcode_blob.bin", &microcode_len); microcode_file = cbfs_map("cpu_microcode_blob.bin", &microcode_len);
if ((microcode_file != NULL) && (microcode_len != 0)) { if ((microcode_file) && (microcode_len != 0)) {
/* Update CPU Microcode patch base address/size */ /* Update CPU Microcode patch base address/size */
s_cfg->MicrocodeRegionBase = (uint32_t)microcode_file; s_cfg->MicrocodeRegionBase = (uint32_t)microcode_file;
s_cfg->MicrocodeRegionSize = (uint32_t)microcode_len; s_cfg->MicrocodeRegionSize = (uint32_t)microcode_len;

View File

@ -43,7 +43,7 @@ static void save_dimm_info(void)
meminfo_hob = fsp_find_extension_hob_by_guid( meminfo_hob = fsp_find_extension_hob_by_guid(
smbios_memory_info_guid, smbios_memory_info_guid,
&hob_size); &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"); printk(BIOS_ERR, "SMBIOS MEMORY_INFO_DATA_HOB not found\n");
return; return;
} }
@ -53,7 +53,7 @@ static void save_dimm_info(void)
* table 17 * table 17
*/ */
mem_info = cbmem_add(CBMEM_ID_MEMINFO, sizeof(*mem_info)); 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"); printk(BIOS_ERR, "CBMEM entry for DIMM info missing\n");
return; return;
} }