[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/34] hw/ppc: use 0 instead of fdt_path_offset(fdt,
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 02/34] hw/ppc: use 0 instead of fdt_path_offset(fdt, "/") |
Date: |
Tue, 17 Oct 2017 15:21:20 +1100 |
From: Greg Kurz <address@hidden>
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 <address@hidden>
Reviewed-by: Cédric Le Goater <address@hidden>
Reviewed-by: Daniel Henrique Barboza <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/pnv.c | 3 +--
hw/ppc/spapr.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
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;
}
--
2.13.6
- [Qemu-devel] [PULL 00/34] ppc-for-2.11 queue 20171017, David Gibson, 2017/10/17
- [Qemu-devel] [PULL 02/34] hw/ppc: use 0 instead of fdt_path_offset(fdt, "/"),
David Gibson <=
- [Qemu-devel] [PULL 01/34] macio: add missing registers to VMStateDescription, David Gibson, 2017/10/17
- [Qemu-devel] [PULL 03/34] target/ppc: Remove unused PPC 460 and 460F definitions, David Gibson, 2017/10/17
- [Qemu-devel] [PULL 04/34] spapr: fix OF word name in comment, David Gibson, 2017/10/17
- [Qemu-devel] [PULL 05/34] spapr: sanity check size of the CAS buffer, David Gibson, 2017/10/17
- [Qemu-devel] [PULL 14/34] ppc: bamboo: use generic cpu_model parsing, David Gibson, 2017/10/17
- [Qemu-devel] [PULL 12/34] ppc: mac_newworld: use generic cpu_model parsing, David Gibson, 2017/10/17
- [Qemu-devel] [PULL 13/34] ppc: mac_oldworld: use generic cpu_model parsing, David Gibson, 2017/10/17
- [Qemu-devel] [PULL 11/34] ppc: mpc8544ds/e500plat: use generic cpu_model parsing, David Gibson, 2017/10/17
- [Qemu-devel] [PULL 16/34] ppc: virtex-ml507: replace cpu_model with cpu_type, David Gibson, 2017/10/17
- [Qemu-devel] [PULL 09/34] qom: introduce type_register_static_array(), David Gibson, 2017/10/17