commit | 5e6b0f0cac4ba5cde6114325ea69ec0e98c7e08f | [log] [tgz] |
---|---|---|
author | Elyes Haouas <ehaouas@noos.fr> | Tue Sep 13 09:55:49 2022 +0200 |
committer | Felix Held <felix-coreboot@felixheld.de> | Wed Sep 14 12:01:24 2022 +0000 |
tree | 06433b2873415812ac1fb28c51819cd89e4caa74 | |
parent | 1fac2e20b8161e1dc93086b4c5498548827f1604 [diff] |
nb/intel: Use "if (!ptr)" in preference to "if (ptr == NULL)" Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Change-Id: I6d0d945011fa046b974c6f4554cb9fb15e523afb Reviewed-on: https://review.coreboot.org/c/coreboot/+/67578 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/northbridge/intel/sandybridge/raminit.c b/src/northbridge/intel/sandybridge/raminit.c index 9082f8a..5044512 100644 --- a/src/northbridge/intel/sandybridge/raminit.c +++ b/src/northbridge/intel/sandybridge/raminit.c
@@ -107,7 +107,7 @@ /* The 'spd_add_smbios17' function allocates this CBMEM area */ struct memory_info *m = cbmem_find(CBMEM_ID_MEMINFO); - if (m == NULL) + if (!m) return; const uint32_t capid0_a = pci_read_config32(HOST_BRIDGE, CAPID0_A);
diff --git a/src/northbridge/intel/sandybridge/raminit_mrc.c b/src/northbridge/intel/sandybridge/raminit_mrc.c index c276d4c..a308d07 100644 --- a/src/northbridge/intel/sandybridge/raminit_mrc.c +++ b/src/northbridge/intel/sandybridge/raminit_mrc.c
@@ -111,7 +111,7 @@ pei_data->mrc_input = mrc_cache_current_mmap_leak(MRC_TRAINING_DATA, MRC_CACHE_VERSION, &mrc_size); - if (pei_data->mrc_input == NULL) { + if (!pei_data->mrc_input) { /* Error message printed in find_current_mrc_cache */ return; }