From patchwork Wed Jun 24 21:56:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 1316603 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=eYUiWano; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49scS41xDyz9sPF for ; Thu, 25 Jun 2020 07:56:52 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0B88B82095; Wed, 24 Jun 2020 23:56:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="eYUiWano"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4E98682095; Wed, 24 Jun 2020 23:56:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 096B282095 for ; Wed, 24 Jun 2020 23:56:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=wdc.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=4379450a5=atish.patra@wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1593035782; x=1624571782; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7R5KHBRKOJiOsKSqdygT1DAZYuwQkyhYmzJV9/rjwoI=; b=eYUiWanoV4Pb9p+DNNm6ubGfolffApKh64dOhH3pxFibX22Y1yaV2k9J Otbc+FOm5XYsqXQM5nS9oP5eAMn7u+Lq5hPzPMdAVLE+yv1My05bILMYH zVh/G7YuvIaSFls3gyteHda00ItDzAJu5+QMXIk6oECvJcgSiuxvjcwMs t/N8RsQ/xCcqIIs8n4NCaaR6aXwjLb6XLanbqN7ZNXYtARwSE839wJfRZ JjoDFe6qBMTV7EXA/wupWF9oszpIcd8903g+WhBFiqxKYNjhgAinALai6 b9nwDB4aPPpxnE/GsyhI0XoVu3QOvVbcNBAiRnjrauoavUyLLNevcnmGX g==; IronPort-SDR: XmgxGWAyQJISZJv9NM0ZUyPmFw5tKnxgLdMvhonfyUk5RrIwloDmS86Aa47GIIv4ioBM45xVn9 Vv6LwlEugrG0SKZkHgB/vRpSz1myHUcRnLL05Lk6mJiEYiojZZfTVe/R1IlB/sWQm6+rn228r9 ZLah+lUQgdverdTBPo/D2quJ5192QrxVVdkAn255y6u8iQcPtHJI4gBOY7oqAKKiKnZzOtQwln yzwOENgMUAVaP7mQGeizBIKaRHuXYQMD7FHchXMydJwMg5YlsJeUv4LeytpHE1ktUF9JfRb5Ql IqU= X-IronPort-AV: E=Sophos;i="5.75,276,1589212800"; d="scan'208";a="142209018" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 25 Jun 2020 05:56:18 +0800 IronPort-SDR: OykVpQj45XaxX0KRklVuRg43ZBie2omQZXE8ETAL5Hf6UBb+wyO6We4RyYUUYaWVbsnTiocepj 5t+KLW/JTH4TiJxPqvjdXAUx5Qq+NYU80= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2020 14:45:20 -0700 IronPort-SDR: IMcF5owNcOS1169YrU2w2UFigtELU/tbyGJxNHoM2dntmKE8yUJymPrjmPVlZk9PuBSOGTfQGL A17GABa4bejQ== WDCIronportException: Internal Received: from usgvt6l72.ad.shared (HELO jedi-01.hgst.com) ([10.86.58.190]) by uls-op-cesaip02.wdc.com with ESMTP; 24 Jun 2020 14:56:18 -0700 From: Atish Patra To: u-boot@lists.denx.de Cc: Atish Patra , Bin Meng , Anup Patel , Bin Meng , Heinrich Schuchardt , Jagan Teki , Marek Vasut , Simon Goldschmidt , David Abdurachmanov , Tom Rini Subject: [PATCH v3 2/2] riscv: Use optimized version of fdtdec_get_addr_size_no_parent Date: Wed, 24 Jun 2020 14:56:15 -0700 Message-Id: <20200624215615.19256-3-atish.patra@wdc.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200624215615.19256-1-atish.patra@wdc.com> References: <20200624215615.19256-1-atish.patra@wdc.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean fdtdec_get_addr_size_no_parent is not an optimized version if parent node is already available with the caller. Use fdtdec_get_addr_size_auto_parent to read the "reg" property Signed-off-by: Atish Patra Reviewed-by: Bin Meng --- arch/riscv/lib/fdt_fixup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c index 05ca41b49dda..fab93873d5c7 100644 --- a/arch/riscv/lib/fdt_fixup.c +++ b/arch/riscv/lib/fdt_fixup.c @@ -44,9 +44,9 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst) fdt_for_each_subnode(node, src, offset) { name = fdt_get_name(src, node, NULL); - addr = fdtdec_get_addr_size_auto_noparent(src, node, - "reg", 0, &size, - false); + addr = fdtdec_get_addr_size_auto_parent(src, offset, node, + "reg", 0, &size, + false); if (addr == FDT_ADDR_T_NONE) { debug("failed to read address/size for %s\n", name); continue;