From patchwork Wed Aug 14 08:19:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J, KEERTHY" X-Patchwork-Id: 1146830 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="AwvADK4A"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 467jGm5TBcz9sN1 for ; Wed, 14 Aug 2019 18:21:36 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 5D33DC21DC1; Wed, 14 Aug 2019 08:21:34 +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 6B973C21C27; Wed, 14 Aug 2019 08:21:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 58718C21C27; Wed, 14 Aug 2019 08:21:31 +0000 (UTC) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lists.denx.de (Postfix) with ESMTPS id 9ADDFC21BE5 for ; Wed, 14 Aug 2019 08:21:30 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x7E8LRun032481; Wed, 14 Aug 2019 03:21:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1565770888; bh=tRfNxWCWer7RrEJgElHusEjVMykVn3G9HjVT3z7PViA=; h=From:To:CC:Subject:Date; b=AwvADK4ATu80yU/5sDSRat2fLtWHK5iFrNp1oh3AniZKVpBFSdgaWxL8Mxcn+2zGG u9ERov876OUCIQNin40/jCgS71WPqgw1DmIw1zsJkwzh7CaIcysbn8wny306eXQKXm UzlvFvdTYTD55cZSiI/gUwRe3C6yjulds+iMHt9I= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x7E8LR3o129267 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 14 Aug 2019 03:21:27 -0500 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE103.ent.ti.com (157.170.170.33) 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 03:21:27 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE115.ent.ti.com (157.170.170.26) 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 03:21:27 -0500 Received: from a0393675ula.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x7E8KQJC023939; Wed, 14 Aug 2019 03:20:41 -0500 From: Keerthy To: , Date: Wed, 14 Aug 2019 13:49:55 +0530 Message-ID: <20190814081955.7122-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] [RFT 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 deined 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. Signed-off-by: Keerthy 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;