diff options
author | Angel Pons <th3fanbus@gmail.com> | 2020-06-08 15:24:32 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-06-10 18:48:24 +0000 |
commit | 7333ea91eae33a874cf5187bc04906f6d2f1e3bf (patch) | |
tree | 09c7815baad98b6ebe4f6fec713da02014251a4f | |
parent | f9be2d10c9a5e377304944de33357ae1ec9bdb7b (diff) |
sb/intel/bd82x6x/pcie.c: Move `pch_pcie_acpi_name` up
The ASSERT() macro depends on the line number, so changing the line it
appears in breaks reproducibility testing using BUILD_TIMELESS=1.
Work around this problem by placing the `pch_pcie_acpi_name` function,
which contains this macro, at the beginning of the file. This allows
refactoring the rest of the code without affecting the ASSERT() macro.
Change-Id: I2e0432ec9ae6c7d033fc7495afb3a71fe7e77729
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42195
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
-rw-r--r-- | src/southbridge/intel/bd82x6x/pcie.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/southbridge/intel/bd82x6x/pcie.c b/src/southbridge/intel/bd82x6x/pcie.c index 5bc3412efa..ff881ac20e 100644 --- a/src/southbridge/intel/bd82x6x/pcie.c +++ b/src/southbridge/intel/bd82x6x/pcie.c @@ -13,6 +13,26 @@ #include "chip.h" #include "pch.h" +static const char *pch_pcie_acpi_name(const struct device *dev) +{ + ASSERT(dev); + + if (PCI_SLOT(dev->path.pci.devfn) == 0x1c) { + static const char *names[] = { "RP01", + "RP02", + "RP03", + "RP04", + "RP05", + "RP06", + "RP07", + "RP08"}; + + return names[PCI_FUNC(dev->path.pci.devfn)]; + } + + return NULL; +} + static void pch_pcie_pm_early(struct device *dev) { u16 link_width_p0, link_width_p4; @@ -272,26 +292,6 @@ static void pch_pciexp_scan_bridge(struct device *dev) pch_pcie_pm_late(dev); } -static const char *pch_pcie_acpi_name(const struct device *dev) -{ - ASSERT(dev); - - if (PCI_SLOT(dev->path.pci.devfn) == 0x1c) { - static const char *names[] = { "RP01", - "RP02", - "RP03", - "RP04", - "RP05", - "RP06", - "RP07", - "RP08"}; - - return names[PCI_FUNC(dev->path.pci.devfn)]; - } - - return NULL; -} - static struct device_operations device_ops = { .read_resources = pci_bus_read_resources, .set_resources = pci_dev_set_resources, |