[Skiboot] [PATCH 6/7] hdata: make for_each_pcia take spiras as an argument
Nicholas Piggin
npiggin at gmail.com
Wed Sep 6 20:10:16 AEST 2023
Have for_each_pcia take spiras as an argument rather than use the
global variable.
Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
hdata/memory.c | 2 +-
hdata/pcia.c | 2 +-
hdata/spira.c | 2 +-
hdata/spira.h | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hdata/memory.c b/hdata/memory.c
index 0b4e78585..53a16253a 100755
--- a/hdata/memory.c
+++ b/hdata/memory.c
@@ -243,7 +243,7 @@ static void add_bus_freq_to_ram_area(struct dt_node *ram_node, u32 chip_id)
return;
}
- for_each_pcia(pcia) {
+ for_each_pcia(spiras, pcia) {
const struct sppcia_core_unique *id;
id = HDIF_get_idata(pcia, SPPCIA_IDATA_CORE_UNIQUE, &size);
diff --git a/hdata/pcia.c b/hdata/pcia.c
index 47f40cfec..36fc84c3a 100644
--- a/hdata/pcia.c
+++ b/hdata/pcia.c
@@ -190,7 +190,7 @@ bool pcia_parse(void)
dt_add_property_cells(cpus, "#address-cells", 1);
dt_add_property_cells(cpus, "#size-cells", 0);
- for_each_pcia(pcia) {
+ for_each_pcia(spiras, pcia) {
const struct sppcia_core_unique *id;
u32 size, ve_flags;
bool okay;
diff --git a/hdata/spira.c b/hdata/spira.c
index 500d317a1..d9325a0b4 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -529,7 +529,7 @@ static void add_xscom_add_pcia_assoc(struct dt_node *np, uint32_t pcid)
if (!hdr)
return;
- for_each_pcia(hdr) {
+ for_each_pcia(spiras, hdr) {
const struct sppcia_core_unique *id;
id = HDIF_get_idata(hdr, SPPCIA_IDATA_CORE_UNIQUE, &size);
diff --git a/hdata/spira.h b/hdata/spira.h
index 1789de1b5..9db9d599f 100644
--- a/hdata/spira.h
+++ b/hdata/spira.h
@@ -123,7 +123,7 @@ extern struct HDIF_common_hdr *__get_hdif(struct spira_ntuple *n,
be32_to_cpu((_ntuples)->alloc_len)); \
_p = (void *)_p + be32_to_cpu((_ntuples)->alloc_len))
-#define for_each_pcia(p) for_each_ntuple(&spiras->ntuples.pcia, p, SPPCIA_HDIF_SIG)
+#define for_each_pcia(s, p) for_each_ntuple(&(s)->ntuples.pcia, p, SPPCIA_HDIF_SIG)
/* We override these for testing. */
#ifndef ntuple_addr
--
2.40.1
More information about the Skiboot
mailing list