From nobody Sun May 5 22:10:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507040078663302.6701062714461; Tue, 3 Oct 2017 07:14:38 -0700 (PDT) Received: from localhost ([::1]:58835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzNxw-0003Fv-N2 for importer@patchew.org; Tue, 03 Oct 2017 10:14:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzNx3-0002m2-JA for qemu-devel@nongnu.org; Tue, 03 Oct 2017 10:13:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzNwy-0003bL-1c for qemu-devel@nongnu.org; Tue, 03 Oct 2017 10:13:37 -0400 Received: from 2.mo177.mail-out.ovh.net ([178.33.109.80]:59432) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dzNwx-0003RZ-PU for qemu-devel@nongnu.org; Tue, 03 Oct 2017 10:13:31 -0400 Received: from player688.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo177.mail-out.ovh.net (Postfix) with ESMTP id 39D7081E4B for ; Tue, 3 Oct 2017 16:13:23 +0200 (CEST) Received: from bahia.lab.toulouse-stg.fr.ibm.com (deibp9eh1--blueice1n3.emea.ibm.com [195.212.29.165]) (Authenticated sender: groug@kaod.org) by player688.ha.ovh.net (Postfix) with ESMTPA id 4EA6620097; Tue, 3 Oct 2017 16:13:18 +0200 (CEST) From: Greg Kurz To: qemu-devel@nongnu.org Date: Tue, 03 Oct 2017 16:13:11 +0200 Message-ID: <150703999112.6139.714822137654210421.stgit@bahia.lab.toulouse-stg.fr.ibm.com> User-Agent: StGit/0.17.1-46-g6855-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 11169490028956260747 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelledrkeejgdegkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 178.33.109.80 Subject: [Qemu-devel] [PATCH] hw/ppc: use 0 instead of fdt_path_offset(fdt, "/") X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, Cedric Le Goater , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 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=C3=A9dric Le Goater Reviewed-by: Daniel Henrique Barboza --- 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 =3D fdt_path_offset(fdt, "/cpus"); =20 if (cpus_offset < 0) { - cpus_offset =3D fdt_add_subnode(fdt, fdt_path_offset(fdt, "/"), - "cpus"); + cpus_offset =3D 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, sPAPRMachineSt= ate *spapr) =20 cpus_offset =3D fdt_path_offset(fdt, "/cpus"); if (cpus_offset < 0) { - cpus_offset =3D fdt_add_subnode(fdt, fdt_path_offset(fdt, "/"), - "cpus"); + cpus_offset =3D fdt_add_subnode(fdt, 0, "cpus"); if (cpus_offset < 0) { return cpus_offset; }