From: Greg Kurz Date: Tue, 3 Oct 2017 14:13:11 +0000 (+0200) Subject: hw/ppc: use 0 instead of fdt_path_offset(fdt, "/") X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a4f3885c7496fa3c5af8ad849f2ec55d9214d66c;p=qemu.git hw/ppc: use 0 instead of fdt_path_offset(fdt, "/") The offset of the root node is guaranteed to be 0. This doesn't fix anything, it's just trivial cleanup of the two remaining places where this was done under hw/ppc. Signed-off-by: Greg Kurz Reviewed-by: Cédric Le Goater Reviewed-by: Daniel Henrique Barboza Signed-off-by: David Gibson --- diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index d46d91c76f..84b2389ea6 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -92,8 +92,7 @@ static int get_cpus_node(void *fdt) int cpus_offset = fdt_path_offset(fdt, "/cpus"); if (cpus_offset < 0) { - cpus_offset = fdt_add_subnode(fdt, fdt_path_offset(fdt, "/"), - "cpus"); + cpus_offset = fdt_add_subnode(fdt, 0, "cpus"); if (cpus_offset) { _FDT((fdt_setprop_cell(fdt, cpus_offset, "#address-cells", 0x1))); _FDT((fdt_setprop_cell(fdt, cpus_offset, "#size-cells", 0x0))); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index ff87f155d5..352ff3d614 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -353,8 +353,7 @@ static int spapr_fixup_cpu_dt(void *fdt, sPAPRMachineState *spapr) cpus_offset = fdt_path_offset(fdt, "/cpus"); if (cpus_offset < 0) { - cpus_offset = fdt_add_subnode(fdt, fdt_path_offset(fdt, "/"), - "cpus"); + cpus_offset = fdt_add_subnode(fdt, 0, "cpus"); if (cpus_offset < 0) { return cpus_offset; }