diff options
author | Jeremy Compostella <jeremy.compostella@intel.com> | 2024-10-01 11:01:34 -0700 |
---|---|---|
committer | Jérémy Compostella <jeremy.compostella@intel.com> | 2024-10-03 16:17:11 +0000 |
commit | f9e877ea2173696028ded8e82fbe51e13085865b (patch) | |
tree | f642c7aec20851003aecded41799f8516116cb6e /src/soc/intel/pantherlake/elog.c | |
parent | b9c0056b2dc4f1f5658d49edf8d8a43b1bcb9536 (diff) |
soc/intel/pantherlake: Remove soc_info.[hc] interface
This commit removes the unnecessary layer provided by soc_info.[hc].
It was providing an abstraction which only was resulting in extra
function calls without any added value as the returned constants are
well identified and could be used directly. More importantly, and this
is the actual selling point in my opinion, this extra indirection was
preventing the compiler from detecting array overflows.
BUG=348678529
TEST=Build is successful
Change-Id: Iea26d962748116fa84afdb4afcba1098a64b6986
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84616
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Diffstat (limited to 'src/soc/intel/pantherlake/elog.c')
-rw-r--r-- | src/soc/intel/pantherlake/elog.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/soc/intel/pantherlake/elog.c b/src/soc/intel/pantherlake/elog.c index fce408f222..7750058be4 100644 --- a/src/soc/intel/pantherlake/elog.c +++ b/src/soc/intel/pantherlake/elog.c @@ -8,7 +8,6 @@ #include <intelblocks/xhci.h> #include <soc/pci_devs.h> #include <soc/pm.h> -#include <soc/soc_info.h> #include <types.h> struct pme_map { @@ -30,9 +29,6 @@ static void pch_log_gpio_gpe(u32 gpe0_sts, u32 gpe0_en, int start) static void pch_log_rp_wake_source(void) { - size_t i; - uint8_t max_port = get_max_pcie_port(); - const struct pme_map pme_map[] = { { PCI_DEVFN_PCIE1, ELOG_WAKE_SOURCE_PME_PCIE1 }, { PCI_DEVFN_PCIE2, ELOG_WAKE_SOURCE_PME_PCIE2 }, @@ -50,7 +46,7 @@ static void pch_log_rp_wake_source(void) #endif }; - for (i = 0; i < MIN(max_port, ARRAY_SIZE(pme_map)); ++i) { + for (size_t i = 0; i < MIN(CONFIG_MAX_ROOT_PORTS, ARRAY_SIZE(pme_map)); i++) { if (pci_dev_is_wake_source(PCI_DEV(0, PCI_SLOT(pme_map[i].devfn), PCI_FUNC(pme_map[i].devfn)))) elog_add_event_wake(pme_map[i].wake_source, 0); |