From patchwork Sun Sep 12 03:15:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1526820 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=cMul64B/; dkim-atps=neutral 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=) 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 4H6ZXG6MGMz9sVw for ; Sun, 12 Sep 2021 13:16:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AA045838F8; Sun, 12 Sep 2021 05:16:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cMul64B/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BF49D838D7; Sun, 12 Sep 2021 05:15:46 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5A03E838D6 for ; Sun, 12 Sep 2021 05:15:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pg1-x52f.google.com with SMTP id 17so5912262pgp.4 for ; Sat, 11 Sep 2021 20:15:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=pXE84FfNJzM1e+j7pJMdAVGD9zIwEP3Qmuc70gL4Jv0=; b=cMul64B/gKVOlB7tFGSaBMWaQMitcjpN7Z7V5HrWcnY+AYChF1oVJNa0k74uo9UA97 Tih3EJOZCdfvaYcZoOkSfu99YS4ec8gV6LTGxmuU7WWbW1QjRxX7eyd+4XoQD9uU1AzK tlpILdKC/IywnGw6eTEvPmT81XSf1Q3iLpx6LeUiL4gARSeojC7lS2r8E0jWMNkYjJLv wB1Oi7B6oSNjatf6pxeU+1xaERg79vGuAF5wZ2Ny9Nqri2TcvXy5T4K7xOG74VXYWDHG 3A7IdCBZVEzax9dZ4k0hZETKl8KuSFhcPQtzwaI+Phx3uQRXciVp+QAA8FBiFB/vnzlh g39Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pXE84FfNJzM1e+j7pJMdAVGD9zIwEP3Qmuc70gL4Jv0=; b=F49NGLUFWIc5qDeCLRFJeoZhWbTk2LeZKZlPsvlA6A5EfnEbzq+osxaibU3pyhFHAO j0ptTeKlquSAqhJ0tEqhc44O7iBowc8esZ6Y3fyw3RaTaDdqB25SUTO8QI2bpNYlytcJ 7coEMk6z6N8hipm65kOb1quqsegobngE/4TmVe6HoWUoWAwAykwz9HmFNh2/tSEVeb0Q YJIgTldtLRQ95Mu96ZmAKKxxp0R0OsnJPOTx2pPfXz9nq4N4p9r6clbhHzA7Uvrpobbo /FxSlv/QCfZ1rWVZliQXOAUXWIktAL3Bjhi/PrxqH54aO4v2qZ2PnALFzgOlJExrghIb 1e9w== X-Gm-Message-State: AOAM530ZyZymLcAbr99QjHCOgYJB85/tVgcde5FFxtd9PKqzU5YGVG6e 26qkBWqL3cYN0VsvKo99Iks= X-Google-Smtp-Source: ABdhPJwyZ9BohIb2AdMD5LPwQGunV7lwLwMd2e3kCYtwVIDK9p0e1smQCtkXeJgs6CRUS/XCZeE2/Q== X-Received: by 2002:aa7:9ae9:0:b0:3f5:e1a7:db23 with SMTP id y9-20020aa79ae9000000b003f5e1a7db23mr4894919pfp.42.1631416540751; Sat, 11 Sep 2021 20:15:40 -0700 (PDT) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id z9sm2924300pfa.2.2021.09.11.20.15.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 20:15:40 -0700 (PDT) From: Bin Meng To: Simon Glass , Rick Chen , Leo Yu-Chi Liang , u-boot@lists.denx.de Subject: [PATCH 8/9] ram: sifive: Fix -Wint-to-pointer-cast warnings Date: Sun, 12 Sep 2021 11:15:15 +0800 Message-Id: <20210912031516.24885-8-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210912031516.24885-1-bmeng.cn@gmail.com> References: <20210912031516.24885-1-bmeng.cn@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.103.2 at phobos.denx.de X-Virus-Status: Clean The following warning is seen in sifive_ddr.c in a 32-bit build: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Change to use dev_read_addr_index_ptr(). Signed-off-by: Bin Meng Reviewed-by: Leo Yu-Chi Liang --- drivers/ram/sifive/sifive_ddr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ram/sifive/sifive_ddr.c b/drivers/ram/sifive/sifive_ddr.c index ba18466033..4bd69a62be 100644 --- a/drivers/ram/sifive/sifive_ddr.c +++ b/drivers/ram/sifive/sifive_ddr.c @@ -313,7 +313,7 @@ static int sifive_ddr_setup(struct udevice *dev) sifive_ddr_phy_fixup(denali_phy); /* check size */ - priv->info.size = get_ram_size((long *)priv->info.base, + priv->info.size = get_ram_size((long *)(uintptr_t)priv->info.base, ddr_size); debug("%s : %lx\n", __func__, (uintptr_t)priv->info.size); @@ -369,9 +369,9 @@ static int sifive_ddr_probe(struct udevice *dev) return ret; } - priv->ctl = (struct sifive_ddrctl *)dev_read_addr_index(dev, 0); - priv->phy = (struct sifive_ddrphy *)dev_read_addr_index(dev, 1); - priv->physical_filter_ctrl = (u32 *)dev_read_addr_index(dev, 2); + priv->ctl = (struct sifive_ddrctl *)dev_read_addr_index_ptr(dev, 0); + priv->phy = (struct sifive_ddrphy *)dev_read_addr_index_ptr(dev, 1); + priv->physical_filter_ctrl = (u32 *)dev_read_addr_index_ptr(dev, 2); return sifive_ddr_setup(dev); #endif