Elyes Haouas has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/83916?usp=email )
Change subject: [Prepare for C23]nb/amd/pi ......................................................................
[Prepare for C23]nb/amd/pi
Modern C provides nullptr constant. Prepare to use it unstead of macro.
Change-Id: I6cb809d8f043c3003d60752dbcf0f22f0130288e Signed-off-by: Elyes Haouas ehaouas@noos.fr --- M src/mainboard/pcengines/apu2/OemCustomize.c M src/northbridge/amd/pi/00730F01/dimmSpd.c M src/northbridge/amd/pi/00730F01/northbridge.c M src/southbridge/amd/pi/hudson/lpc.c M src/southbridge/amd/pi/hudson/pci.c 5 files changed, 23 insertions(+), 23 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/16/83916/1
diff --git a/src/mainboard/pcengines/apu2/OemCustomize.c b/src/mainboard/pcengines/apu2/OemCustomize.c index 95af6ef..c47b12b 100644 --- a/src/mainboard/pcengines/apu2/OemCustomize.c +++ b/src/mainboard/pcengines/apu2/OemCustomize.c @@ -71,7 +71,7 @@ .Flags = DESCRIPTOR_TERMINATE_LIST, .SocketId = 0, .PciePortList = PortList, - .DdiLinkList = NULL, + .DdiLinkList = nullptr, };
void board_BeforeInitEarly(struct sysinfo *cb, AMD_EARLY_PARAMS *InitEarly) diff --git a/src/northbridge/amd/pi/00730F01/dimmSpd.c b/src/northbridge/amd/pi/00730F01/dimmSpd.c index c24466e..0108f3e 100644 --- a/src/northbridge/amd/pi/00730F01/dimmSpd.c +++ b/src/northbridge/amd/pi/00730F01/dimmSpd.c @@ -16,12 +16,12 @@ int spdAddress; DEVTREE_CONST struct device *dev = pcidev_on_root(0x18, 2);
- if (dev == NULL) + if (dev == nullptr) return AGESA_ERROR;
DEVTREE_CONST struct northbridge_amd_pi_00730F01_config *config = dev->chip_info;
- if (config == NULL) + if (config == nullptr) return AGESA_ERROR;
if (info->SocketId >= ARRAY_SIZE(config->spdAddrLookup)) diff --git a/src/northbridge/amd/pi/00730F01/northbridge.c b/src/northbridge/amd/pi/00730F01/northbridge.c index 1be9421..f315cd4 100644 --- a/src/northbridge/amd/pi/00730F01/northbridge.c +++ b/src/northbridge/amd/pi/00730F01/northbridge.c @@ -98,11 +98,11 @@ current = (void *)(hest + 1);
addr = agesawrapper_getlateinitptr(PICK_WHEA_MCE); - if (addr != NULL) + if (addr != nullptr) current += acpi_create_hest_error_source(hest, current, 0, (void *)((u32)addr + 2), *(UINT16 *)addr - 2);
addr = agesawrapper_getlateinitptr(PICK_WHEA_CMC); - if (addr != NULL) + if (addr != nullptr) current += acpi_create_hest_error_source(hest, current, 1, (void *)((u32)addr + 2), *(UINT16 *)addr - 2);
return (unsigned long)current; @@ -270,7 +270,7 @@
/* * These devices should be already found by previous function. - * Do not perform NULL checks. + * Do not perform nullptr checks. */ struct device *nb_dev = pcidev_on_root(0, 0); struct device *iommu_dev = pcidev_on_root(0, 2); @@ -313,7 +313,7 @@ current_backup = current; current = ivhd_dev_range(current, PCI_DEVFN(1, 0), PCI_DEVFN(0x1f, 6), 0); ivhd_11->length += (current - current_backup); - add_ivhd_device_entries(NULL, all_devices, 0, -1, NULL, ¤t, &ivhd_11->length); + add_ivhd_device_entries(nullptr, all_devices, 0, -1, nullptr, ¤t, &ivhd_11->length);
/* Describe HPET */ current_backup = current; @@ -350,7 +350,7 @@ }
ivrs_agesa = agesawrapper_getlateinitptr(PICK_IVRS); - if (ivrs_agesa != NULL) { + if (ivrs_agesa != nullptr) { ivrs->iv_info = ivrs_agesa->iv_info; ivrs->ivhd.type = IVHD_BLOCK_TYPE_LEGACY__FIXED; ivrs->ivhd.flags = ivrs_agesa->ivhd.flags; @@ -368,7 +368,7 @@ if (pci_read_config32(iommu_dev, ivrs->ivhd.capability_offset) & EFR_SUPPORT) ivrs->iv_info |= IVINFO_EFR_SUPPORTED; } else { - printk(BIOS_WARNING, "%s: AGESA returned NULL IVRS\n", __func__); + printk(BIOS_WARNING, "%s: AGESA returned nullptr IVRS\n", __func__);
return (unsigned long)ivrs; } @@ -381,7 +381,7 @@ current_backup = current; current = ivhd_dev_range(current, PCI_DEVFN(1, 0), PCI_DEVFN(0x1f, 6), 0); ivrs->ivhd.length += (current - current_backup); - add_ivhd_device_entries(NULL, all_devices, 0, -1, NULL, ¤t, &ivrs->ivhd.length); + add_ivhd_device_entries(nullptr, all_devices, 0, -1, nullptr, ¤t, &ivrs->ivhd.length);
/* Describe HPET */ current_backup = current; @@ -447,40 +447,40 @@ current = ALIGN_UP(current, 8); printk(BIOS_DEBUG, "ACPI: * SRAT at %lx\n", current); srat = (acpi_srat_t *)agesawrapper_getlateinitptr(PICK_SRAT); - if (srat != NULL) { + if (srat != nullptr) { memcpy((void *)current, srat, srat->header.length); srat = (acpi_srat_t *)current; current += srat->header.length; acpi_add_table(rsdp, srat); } else { - printk(BIOS_DEBUG, " AGESA SRAT table NULL. Skipping.\n"); + printk(BIOS_DEBUG, " AGESA SRAT table nullptr. Skipping.\n"); }
/* SLIT */ current = ALIGN_UP(current, 8); printk(BIOS_DEBUG, "ACPI: * SLIT at %lx\n", current); slit = (acpi_slit_t *)agesawrapper_getlateinitptr(PICK_SLIT); - if (slit != NULL) { + if (slit != nullptr) { memcpy((void *)current, slit, slit->header.length); slit = (acpi_slit_t *)current; current += slit->header.length; acpi_add_table(rsdp, slit); } else { - printk(BIOS_DEBUG, " AGESA SLIT table NULL. Skipping.\n"); + printk(BIOS_DEBUG, " AGESA SLIT table nullptr. Skipping.\n"); }
/* ALIB */ current = ALIGN_UP(current, 16); printk(BIOS_DEBUG, "ACPI: * AGESA ALIB SSDT at %lx\n", current); alib = (acpi_header_t *)agesawrapper_getlateinitptr(PICK_ALIB); - if (alib != NULL) { + if (alib != nullptr) { memcpy((void *)current, alib, alib->length); alib = (acpi_header_t *)current; current += alib->length; acpi_add_table(rsdp, (void *)alib); } else { - printk(BIOS_DEBUG, " AGESA ALIB SSDT table NULL. Skipping.\n"); + printk(BIOS_DEBUG, " AGESA ALIB SSDT table nullptr. Skipping.\n"); }
/* this pstate ssdt may cause Blue Screen: Fixed: Keep this comment for a while. */ @@ -488,13 +488,13 @@ current = ALIGN_UP(current, 16); printk(BIOS_DEBUG, "ACPI: * SSDT at %lx\n", current); ssdt = (acpi_header_t *)agesawrapper_getlateinitptr(PICK_PSTATE); - if (ssdt != NULL) { + if (ssdt != nullptr) { memcpy((void *)current, ssdt, ssdt->length); ssdt = (acpi_header_t *)current; current += ssdt->length; } else { - printk(BIOS_DEBUG, " AGESA PState table NULL. Skipping.\n"); + printk(BIOS_DEBUG, " AGESA PState table nullptr. Skipping.\n"); } acpi_add_table(rsdp, ssdt);
@@ -547,7 +547,7 @@
/* disable No Snoop */ dev = pcidev_on_root(1, 1); - if (dev != NULL) { + if (dev != nullptr) { pci_and_config32(dev, 0x60, ~(1 << 11)); } } @@ -647,7 +647,7 @@ if (dev->path.type == DEVICE_PATH_DOMAIN) return "PCI0";
- return NULL; + return nullptr; }
struct device_operations amd_fam16_mod30_pci_domain_ops = { diff --git a/src/southbridge/amd/pi/hudson/lpc.c b/src/southbridge/amd/pi/hudson/lpc.c index 66ec824..4538454 100644 --- a/src/southbridge/amd/pi/hudson/lpc.c +++ b/src/southbridge/amd/pi/hudson/lpc.c @@ -317,12 +317,12 @@ static const char *lpc_acpi_name(const struct device *dev) { if (dev->path.type != DEVICE_PATH_PCI) - return NULL; + return nullptr;
if (dev->path.pci.devfn == LPC_DEVFN) return "LIBR";
- return NULL; + return nullptr; }
static void lpc_final(struct device *dev) diff --git a/src/southbridge/amd/pi/hudson/pci.c b/src/southbridge/amd/pi/hudson/pci.c index b99413c..33ffe5d 100644 --- a/src/southbridge/amd/pi/hudson/pci.c +++ b/src/southbridge/amd/pi/hudson/pci.c @@ -24,7 +24,7 @@ * Hook this function into the PCI state machine * on entry into BS_DEV_ENABLE. */ -BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, set_pci_irqs, NULL); +BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, set_pci_irqs, nullptr);
static struct pci_operations lops_pci = { .set_subsystem = 0,