qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH] hw/ppc: use 0 instead of fdt_path_offset(fdt, "/"


From: Daniel Henrique Barboza
Subject: Re: [Qemu-ppc] [PATCH] hw/ppc: use 0 instead of fdt_path_offset(fdt, "/")
Date: Tue, 3 Oct 2017 14:21:27 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0



On 10/03/2017 11:13 AM, Greg Kurz wrote:
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: Daniel Henrique Barboza <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 d46d91c76f5c..84b2389ea60b 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 ff87f155d55e..352ff3d614e8 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;
              }






reply via email to

[Prev in Thread] Current Thread [Next in Thread]