[Pdbg] [RFC 05/12] device.c: Extend dt_expand to operate with different root nodes
Amitay Isaacs
amitay at ozlabs.org
Tue Aug 20 13:54:27 AEST 2019
We definitely need to make most functions take arguments and not use
globals. :-)
Reviewed-by: Amitay Isaacs <amitay at ozlabs.org>
On Tue, 2019-08-06 at 11:37 +1000, Alistair Popple wrote:
> Signed-off-by: Alistair Popple <alistair at popple.id.au>
> ---
> libpdbg/device.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libpdbg/device.c b/libpdbg/device.c
> index 07f373d..2fcb184 100644
> --- a/libpdbg/device.c
> +++ b/libpdbg/device.c
> @@ -574,11 +574,11 @@ static int dt_expand_node(struct pdbg_target
> *node, const void *fdt, int fdt_nod
> return nextoffset;
> }
>
> -static void dt_expand(const void *fdt)
> +static void dt_expand(void *root, const void *fdt)
> {
> PR_DEBUG("FDT: Parsing fdt @%p\n", fdt);
>
> - if (dt_expand_node(pdbg_dt_root, fdt, 0) < 0)
> + if (dt_expand_node(root, fdt, 0) < 0)
> abort();
> }
>
> @@ -634,7 +634,7 @@ void pdbg_targets_init(void *fdt)
> return;
> }
>
> - dt_expand(fdt);
> + dt_expand(pdbg_dt_root, fdt);
> }
>
> char *pdbg_target_path(const struct pdbg_target *target)
> --
> 2.20.1
>
Amitay.
--
The unleashed power of the atom has changed everything save our modes
of thinking, and we thus drift toward unparalleled catastrophe.
- Albert Einstein
More information about the Pdbg
mailing list