From patchwork Wed Aug 14 10:26:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J, KEERTHY" X-Patchwork-Id: 1146933 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="Ty8l93+f"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 467m311YGhz9sDB for ; Wed, 14 Aug 2019 20:26:37 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CF766C21DA2; Wed, 14 Aug 2019 10:26:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 69E00C21C29; Wed, 14 Aug 2019 10:26:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 60CDDC21C29; Wed, 14 Aug 2019 10:26:26 +0000 (UTC) Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lists.denx.de (Postfix) with ESMTPS id 8BADAC21C27 for ; Wed, 14 Aug 2019 10:26:25 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x7EAQMbq113850; Wed, 14 Aug 2019 05:26:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1565778382; bh=3IMe0tXXvi6tqjmW50h7/kwyw6/gIruB5QYlzdNaL70=; h=From:To:CC:Subject:Date; b=Ty8l93+fRAvQH9eKZxjoqPqsXaMEA6h/W6DNrhFTGnczcuhkOQWBWR2dGX5/ez6VY L8BsWWcb7Jo6nB4VR8/UEng9lb5dYIujZOSSHgDjOfB4V3YDhelP0es1ZBPTW7GyrU GMyQdavcYnj8MiVCYRgm0w6wpe0VkCta3o9Voas8= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x7EAQMGk007435 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 14 Aug 2019 05:26:22 -0500 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 14 Aug 2019 05:26:22 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Wed, 14 Aug 2019 05:26:22 -0500 Received: from a0393675ula.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id x7EAQJAI066643; Wed, 14 Aug 2019 05:26:20 -0500 From: Keerthy To: , Date: Wed, 14 Aug 2019 15:56:48 +0530 Message-ID: <20190814102648.23082-1-j-keerthy@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: t-kristo@ti.com, u-boot@lists.denx.de Subject: [U-Boot] [PATCH] core: of_addr: Correct the size type of of_get_address to fdt_size_t X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" Currently the size parameter is defined as u64 type. Correct the size type of of_get_address to fdt_size_t so that both 64 bit and 32 bit architectures are taken care of. The initial bug report: https://patchwork.ozlabs.org/patch/1090094/#2212555 Fixes: e679d03b08fb ("core: ofnode: Add ofnode_get_addr_size_index") Reported-by: Eugeniu Rosca Tested-by: Eugeniu Rosca Signed-off-by: Keerthy --- Changes from RFT: * Fixed a typo in the commit log. * Added Reported-by: Eugeniu Rosca Tested-by: Eugeniu Rosca drivers/core/of_addr.c | 4 ++-- drivers/core/ofnode.c | 2 +- include/dm/of_addr.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/core/of_addr.c b/drivers/core/of_addr.c index 4e256d9926..812a400b19 100644 --- a/drivers/core/of_addr.c +++ b/drivers/core/of_addr.c @@ -122,7 +122,7 @@ static void dev_count_cells(const struct device_node *np, int *nap, int *nsp) } const __be32 *of_get_address(const struct device_node *dev, int index, - u64 *size, unsigned int *flags) + fdt_size_t *size, unsigned int *flags) { const __be32 *prop; int psize; @@ -347,7 +347,7 @@ int of_address_to_resource(const struct device_node *dev, int index, struct resource *r) { const __be32 *addrp; - u64 size; + fdt_size_t size; unsigned int flags; const char *name = NULL; diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index 2ac73af934..b21b5183a3 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -260,7 +260,7 @@ fdt_addr_t ofnode_get_addr_size_index(ofnode node, int index, fdt_size_t *size) uint flags; prop_val = of_get_address(ofnode_to_np(node), index, - (u64 *)size, &flags); + size, &flags); if (!prop_val) return FDT_ADDR_T_NONE; diff --git a/include/dm/of_addr.h b/include/dm/of_addr.h index 3fa1ffce81..52443ef296 100644 --- a/include/dm/of_addr.h +++ b/include/dm/of_addr.h @@ -58,7 +58,7 @@ u64 of_translate_dma_address(const struct device_node *no, const __be32 *in_addr * @return pointer to address which can be read */ const __be32 *of_get_address(const struct device_node *no, int index, - u64 *size, unsigned int *flags); + fdt_size_t *size, unsigned int *flags); struct resource;