summaryrefslogtreecommitdiff
path: root/src/soc/intel/xeon_sp/skx
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2022-09-13 10:03:44 +0200
committerFelix Held <felix-coreboot@felixheld.de>2022-09-15 13:03:28 +0000
commitf1ba7d6c8f844110c2bc05fa26e4cea9038672db (patch)
treef6e3d0da0391ae5d797deaf7db276f2a32e2114f /src/soc/intel/xeon_sp/skx
parent3de12533184ea13198de6c02fd83e331a894b075 (diff)
soc/intel/xeon_sp: Use "if (!ptr)" in preference to "if (ptr == NULL)"
Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Change-Id: I664f5b7d354b0d9a7144c25604ae4efbdd9ba9a9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/67593 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jonathan Zhang <jonzhang@fb.com>
Diffstat (limited to 'src/soc/intel/xeon_sp/skx')
-rw-r--r--src/soc/intel/xeon_sp/skx/chip.c2
-rw-r--r--src/soc/intel/xeon_sp/skx/cpu.c2
-rw-r--r--src/soc/intel/xeon_sp/skx/hob_display.c6
-rw-r--r--src/soc/intel/xeon_sp/skx/soc_util.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/soc/intel/xeon_sp/skx/chip.c b/src/soc/intel/xeon_sp/skx/chip.c
index 92f2afa099..78507879d1 100644
--- a/src/soc/intel/xeon_sp/skx/chip.c
+++ b/src/soc/intel/xeon_sp/skx/chip.c
@@ -78,7 +78,7 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *silupd)
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 */
silupd->FspsConfig.PcdCpuMicrocodePatchBase =
(uint32_t)microcode_file;
diff --git a/src/soc/intel/xeon_sp/skx/cpu.c b/src/soc/intel/xeon_sp/skx/cpu.c
index 027e9bbcd3..d2e4af1cd9 100644
--- a/src/soc/intel/xeon_sp/skx/cpu.c
+++ b/src/soc/intel/xeon_sp/skx/cpu.c
@@ -61,7 +61,7 @@ static void xeon_sp_core_init(struct device *cpu)
printk(BIOS_INFO, "%s dev: %s, cpu: %d, apic_id: 0x%x\n",
__func__, dev_path(cpu), cpu_index(), cpu->path.apic.apic_id);
- assert(chip_config != NULL);
+ assert(chip_config);
/* set MSR_PKG_CST_CONFIG_CONTROL - scope per core*/
msr.hi = 0;
diff --git a/src/soc/intel/xeon_sp/skx/hob_display.c b/src/soc/intel/xeon_sp/skx/hob_display.c
index 4f9636d380..efe1038dfb 100644
--- a/src/soc/intel/xeon_sp/skx/hob_display.c
+++ b/src/soc/intel/xeon_sp/skx/hob_display.c
@@ -37,7 +37,7 @@ void soc_display_hob(const struct hob_header *hob)
const struct hob_resource *res;
res = fsp_hob_header_to_resource(hob);
- assert(res != NULL);
+ assert(res);
printk(BIOS_DEBUG, "\tResource type: 0x%x, attribute: 0x%x, addr: 0x%08llx, len: 0x%08llx\n",
res->type, res->attribute_type, res->addr, res->length);
printk(BIOS_DEBUG, "\tOwner GUID: ");
@@ -57,7 +57,7 @@ void soc_display_memmap_hob(void)
size_t hob_size = 0;
const struct SystemMemoryMapHob *hob =
fsp_find_extension_hob_by_guid(fsp_hob_memmap_guid, &hob_size);
- assert(hob != NULL && hob_size != 0);
+ assert(hob && hob_size != 0);
printk(BIOS_DEBUG, "===================== MEMORY MAP HOB DATA =====================\n");
printk(BIOS_DEBUG, "hob: %p, hob_size: 0x%zx, SystemMemoryMapHob size: 0x%zx, "
@@ -90,7 +90,7 @@ void soc_display_iio_universal_data_hob(void)
size_t hob_size = 0;
const IIO_UDS *hob = fsp_find_extension_hob_by_guid(fsp_hob_iio_uds_guid, &hob_size);
- assert(hob != NULL && hob_size != 0);
+ assert(hob && hob_size != 0);
printk(BIOS_DEBUG, "===================== IIO_UDS HOB DATA =====================\n");
diff --git a/src/soc/intel/xeon_sp/skx/soc_util.c b/src/soc/intel/xeon_sp/skx/soc_util.c
index cc8db642b8..3258007f1c 100644
--- a/src/soc/intel/xeon_sp/skx/soc_util.c
+++ b/src/soc/intel/xeon_sp/skx/soc_util.c
@@ -50,7 +50,7 @@ const struct SystemMemoryMapHob *get_system_memory_map(void)
const struct SystemMemoryMapHob *memmap_addr;
memmap_addr = fsp_find_extension_hob_by_guid(mem_hob_guid, &hob_size);
- assert(memmap_addr != NULL && hob_size != 0);
+ assert(memmap_addr && hob_size != 0);
return memmap_addr;
}