mirror of https://github.com/xqemu/xqemu.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 <groug@kaod.org> Reviewed-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
c2a0125a83
commit
a4f3885c74
|
@ -92,8 +92,7 @@ static int get_cpus_node(void *fdt)
|
||||||
int cpus_offset = fdt_path_offset(fdt, "/cpus");
|
int cpus_offset = fdt_path_offset(fdt, "/cpus");
|
||||||
|
|
||||||
if (cpus_offset < 0) {
|
if (cpus_offset < 0) {
|
||||||
cpus_offset = fdt_add_subnode(fdt, fdt_path_offset(fdt, "/"),
|
cpus_offset = fdt_add_subnode(fdt, 0, "cpus");
|
||||||
"cpus");
|
|
||||||
if (cpus_offset) {
|
if (cpus_offset) {
|
||||||
_FDT((fdt_setprop_cell(fdt, cpus_offset, "#address-cells", 0x1)));
|
_FDT((fdt_setprop_cell(fdt, cpus_offset, "#address-cells", 0x1)));
|
||||||
_FDT((fdt_setprop_cell(fdt, cpus_offset, "#size-cells", 0x0)));
|
_FDT((fdt_setprop_cell(fdt, cpus_offset, "#size-cells", 0x0)));
|
||||||
|
|
|
@ -353,8 +353,7 @@ static int spapr_fixup_cpu_dt(void *fdt, sPAPRMachineState *spapr)
|
||||||
|
|
||||||
cpus_offset = fdt_path_offset(fdt, "/cpus");
|
cpus_offset = fdt_path_offset(fdt, "/cpus");
|
||||||
if (cpus_offset < 0) {
|
if (cpus_offset < 0) {
|
||||||
cpus_offset = fdt_add_subnode(fdt, fdt_path_offset(fdt, "/"),
|
cpus_offset = fdt_add_subnode(fdt, 0, "cpus");
|
||||||
"cpus");
|
|
||||||
if (cpus_offset < 0) {
|
if (cpus_offset < 0) {
|
||||||
return cpus_offset;
|
return cpus_offset;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue