]> git.proxmox.com Git - mirror_qemu.git/commitdiff
spapr: Skip leading zeroes from memory@ DT node names
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Tue, 3 Sep 2019 02:34:34 +0000 (12:34 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 4 Oct 2019 00:25:23 +0000 (10:25 +1000)
The device tree build by QEMU at the machine reset time is used by SLOF
to build its internal device tree but the node names are not preserved
exactly so when QEMU provides a device tree update in response to H_CAS,
it might become tricky to match a node from the update blob to
the actual node in SLOF.

This removed leading zeroes from "memory@" nodes and makes
the DTC checker happy.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
hw/ppc/spapr.c

index c69c0341832ddce3cbb8a6c7b91a878c00fdb7ce..42a5b8d2fda3bfca11f38ae15363b1439c49afa9 100644 (file)
@@ -388,7 +388,7 @@ static int spapr_populate_memory_node(void *fdt, int nodeid, hwaddr start,
     mem_reg_property[0] = cpu_to_be64(start);
     mem_reg_property[1] = cpu_to_be64(size);
 
-    sprintf(mem_name, "memory@" TARGET_FMT_lx, start);
+    sprintf(mem_name, "memory@%" HWADDR_PRIx, start);
     off = fdt_add_subnode(fdt, 0, mem_name);
     _FDT(off);
     _FDT((fdt_setprop_string(fdt, off, "device_type", "memory")));