From fe3004fdb991bebcfdc682ef625d53b7835e9bb8 Mon Sep 17 00:00:00 2001 From: Nicholas Piggin Date: Wed, 6 Sep 2023 20:10:16 +1000 Subject: hdata: make for_each_pcia take spiras as an argument Have for_each_pcia take spiras as an argument rather than use the global variable. Signed-off-by: Nicholas Piggin Signed-off-by: Reza Arbab --- 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 0b4e785..53a1625 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 47f40cf..36fc84c 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 500d317..d9325a0 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 1789de1..9db9d59 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 -- cgit v1.1