From patchwork Sun Sep 12 03:15:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1526814 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=oRn0b+74; 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) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H6ZW11Zx3z9sVw for ; Sun, 12 Sep 2021 13:15:39 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B3A13838D4; Sun, 12 Sep 2021 05:15:30 +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="oRn0b+74"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7F4D8838D6; Sun, 12 Sep 2021 05:15:29 +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-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) (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 541B4838CB for ; Sun, 12 Sep 2021 05:15:26 +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-x536.google.com with SMTP id t1so5912957pgv.3 for ; Sat, 11 Sep 2021 20:15:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=EUSZj7EwSIlvi5kivUP/n36i0FrraTTOlgDvUJiYYuU=; b=oRn0b+74V25Mu4FgYKfUfHsUqYhEdi5Z9QSUZUIaTzJACYDoXQuj80VUOKiyLgX+AJ qwBSqU7jxjmTEFtVkE7G2dYtH8Oa3r6e748j/h1++OZs8+laf8PNV0GlYMcYmV76RxUG ZQ1otTsPV+GaVvsRprb4HH9HUYR7kt1igD0qI2PRgxsmhExHDs7CU++BHH4l/Resx3y6 +Z9sJ5SyDle97eoHmJ7mzLx2CH7GcIuWNQdahS5/o1G+zbZXAXSg4P4ieml4tqmHwJNC SiTa3rjVuf2BgM+Q7gHuKB0wirUfDgx6vWtJmsUWLq3ujmMq+Z+5pH1kgqFOagvGZguJ REKQ== 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:mime-version :content-transfer-encoding; bh=EUSZj7EwSIlvi5kivUP/n36i0FrraTTOlgDvUJiYYuU=; b=XCkSuxLvTwbtFPzWhJbDpLe84kh3wfzlo7Rt5qedH4oNA/ONnKFAod7uj2RQmLbYl3 UKKoPxydVMjy58EUl+dLSWsAtXYBsGQr9n/AX9NugbHtaTS1j4aZUzzhNwb1lqs3BFnL YeuXgzvppS4RW05gb6XhBcZZpAIYvrqPs949Y/Jc8yonLbwe5rz61ZIb773sfNfzY/OA oNOlwuwynJ6VeE1yc9/mC57m/VEPfmaICZAY2oya5UpMP29vj0y5J8s20lfa59KKb1/+ IHo2BAwvfOhfEO+ZpkoZGbScKo6K3LteyftCBbvdCg/egjsjmQsgiUcdiNhGhzf8rAYc 2dvg== X-Gm-Message-State: AOAM5313OCvW/+UvneDigdsfI7BASVA8txcL2VydFf1tt6+O1dqxIv0T xhcPfUoD1VxWWbkjlDTN494= X-Google-Smtp-Source: ABdhPJwgBjGGFLbm+eAnK1F+UbBxEgzYFWClGXROgVt9Q+R6/DAEVxdQ2MO2tEsMXzj2QHYXIKna/w== X-Received: by 2002:a63:204a:: with SMTP id r10mr4915906pgm.365.1631416524627; Sat, 11 Sep 2021 20:15:24 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 20:15:24 -0700 (PDT) From: Bin Meng To: Simon Glass , Rick Chen , Leo Yu-Chi Liang , u-boot@lists.denx.de Subject: [PATCH 1/9] cache: sifive: Fix -Wint-to-pointer-cast warning Date: Sun, 12 Sep 2021 11:15:08 +0800 Message-Id: <20210912031516.24885-1-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 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 cache-sifive-ccache.c in a 32-bit build: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Fix by casting it with uintptr_t. Signed-off-by: Bin Meng Reviewed-by: Leo Yu-Chi Liang --- drivers/cache/cache-sifive-ccache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cache/cache-sifive-ccache.c b/drivers/cache/cache-sifive-ccache.c index 76c0ab26ae..c8766f6242 100644 --- a/drivers/cache/cache-sifive-ccache.c +++ b/drivers/cache/cache-sifive-ccache.c @@ -38,7 +38,7 @@ static int sifive_ccache_get_info(struct udevice *dev, struct cache_info *info) { struct sifive_ccache *priv = dev_get_priv(dev); - info->base = (phys_addr_t)priv->base; + info->base = (uintptr_t)priv->base; return 0; } From patchwork Sun Sep 12 03:15:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1526815 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=RhUgJ3lW; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H6ZWG2Bjwz9sVw for ; Sun, 12 Sep 2021 13:15:54 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DE541838DD; Sun, 12 Sep 2021 05:15:35 +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="RhUgJ3lW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 022F2838D9; Sun, 12 Sep 2021 05:15:32 +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-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) (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 882CA838D5 for ; Sun, 12 Sep 2021 05:15:28 +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-x52e.google.com with SMTP id h3so5907672pgb.7 for ; Sat, 11 Sep 2021 20:15:28 -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=XsyD7dKuyD8r4A/ssSLPxPkv9Zwq1IM8+Q6G9kzIZog=; b=RhUgJ3lWqUTauGH7zxjZxem6D5Bzz1gXrT/W5pQmK4aNRbh4IEmnRR3M/c+NfhnpYS gdVfK52AeT/AKnhWO6nyzubqQk9u7DfAdCnkDmVTRZWZed72NmmZ/cwCj8XsC0kvFWwC I3eFwqREPAAVpGYSxAo93LgzZd80afZybh8x4BW3UWtHxl86nBheHby5IRn/QdT/kare et8dNQHGDTY5iy3dkm6PyuBpwQstzjwqiCjvL1Q8Xm4w7vHaTdUKxjTHAP3nH2Sfrrf1 tNBdUxA/SYShkHiZZFOzbxMzoiPf/mQT4xD4CkBCN4NenMevrms2l60lIFl8emSuRU/U jKog== 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=XsyD7dKuyD8r4A/ssSLPxPkv9Zwq1IM8+Q6G9kzIZog=; b=6xcEkeYLLi/UbpmiYtT7vUNZF8ItoLD6gRfbd0WZRbFjZSNuajzPCjgQET/Oy23rEZ 88UlyYWThC9h4gvTYKt/K0p3VQAi+jjEPewf3eizONNvOlSCmWbs17W78h2HOUL8MT0t ECx/Xr7rXt3zgKt6nKxe4cxGfWwLnxZilvFVBPaiaOqGak+AsuTVKwTOcUCa4Eio+O23 COgNldaRhYbVknzhKvNyhCj9200Kw3VhCG4GyHoXkBPzIQP/rZYRSZPSKq0FGlSes+9x xxtM5mKGLDsiSZF3NC+7n8sLIehjE/bLF6IfAOAJYFe3Ijtth+bAn+GQPMMG+zByVHpE d2lw== X-Gm-Message-State: AOAM531EGHNJUIi6ma3QaapX3N+gSdhl+P3pGHjAl5WD8Q9VV6no8Xsh zdYusSXcCeBUAe8QadDIipE= X-Google-Smtp-Source: ABdhPJyGcS8QreA9muh50FbYTx53tUG7ql/0O0Iznw6L6jZ9k9N7Ac4W4Gznxu6n0xpEcvtAB2OG5Q== X-Received: by 2002:a62:3887:0:b0:3f2:6c5a:8a92 with SMTP id f129-20020a623887000000b003f26c5a8a92mr4879600pfa.8.1631416526923; Sat, 11 Sep 2021 20:15:26 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 20:15:26 -0700 (PDT) From: Bin Meng To: Simon Glass , Rick Chen , Leo Yu-Chi Liang , u-boot@lists.denx.de Subject: [PATCH 2/9] clk: sifive: Fix -Wint-to-pointer-cast warning Date: Sun, 12 Sep 2021 11:15:09 +0800 Message-Id: <20210912031516.24885-2-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 dev_read_addr() returns a value of type fdt_addr_t which is a 64-bit address and pd->va is a pointer. In a 32-bit build, this causes the following warning seen when building sifive-prci.c: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Change to use dev_read_addr_ptr(). Signed-off-by: Bin Meng Reviewed-by: Leo Yu-Chi Liang --- drivers/clk/sifive/sifive-prci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clk/sifive/sifive-prci.c b/drivers/clk/sifive/sifive-prci.c index cd1acb9442..52ae268e0c 100644 --- a/drivers/clk/sifive/sifive-prci.c +++ b/drivers/clk/sifive/sifive-prci.c @@ -653,9 +653,9 @@ static int sifive_prci_probe(struct udevice *dev) struct prci_clk_desc *data = (struct prci_clk_desc *)dev_get_driver_data(dev); - pd->va = (void *)dev_read_addr(dev); - if (IS_ERR(pd->va)) - return PTR_ERR(pd->va); + pd->va = dev_read_addr_ptr(dev); + if (!pd->va) + return -EINVAL; err = clk_get_by_index(dev, 0, &pd->parent_hfclk); if (err) From patchwork Sun Sep 12 03:15:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1526816 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=ENGy9fpx; 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 4H6ZWN702Jz9sVw for ; Sun, 12 Sep 2021 13:16:00 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E5104838E9; Sun, 12 Sep 2021 05:15:44 +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="ENGy9fpx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4D9CD838D9; Sun, 12 Sep 2021 05:15:35 +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-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) (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 1DE9F838D6 for ; Sun, 12 Sep 2021 05:15:31 +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-pj1-x1035.google.com with SMTP id m21-20020a17090a859500b00197688449c4so4139959pjn.0 for ; Sat, 11 Sep 2021 20:15:31 -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=TYSci9eNogxTxuxYdeMd85//ipNN9oZc4vNe5D9LXZs=; b=ENGy9fpxjOEbYuZ8cHbQrCbX288hx3PW8rDOJPCR5HXXJV/pP03HATSKcRzwIXpHvm Kn2Uu5Z8QOaKURO+gIl0h5rmY4SdGNVTCdqG0dS2x66pLs6CdJasmje3hYozNrku2uIJ zC3suoLbZ27EyZ8LeFy/YocfrGmfJx1xKouJ+LBDLUqpDArv0tkjZlneyIwwyN7hNBZf lzQS/FecEytvhGW2kc0sxrFjdQrMO0wfyFoy+voKJlMJqmjaiSX4fowRc7pJ3f7vTQ7a xolUxKLynubbBVadwoTXhdJKVcSacY7EcGVZUg6FpO35gqlUSvrv/nQ+voSD+/1LUBhI 4a8Q== 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=TYSci9eNogxTxuxYdeMd85//ipNN9oZc4vNe5D9LXZs=; b=if/qtQcgN+2Vu+e5LJpIiUaKSBP1tzbYm5rWfmHXRi8pmTYTR8+7N/qNsksD9g9sdt QIEUn+952Yx/kiUtbvu3cn6im1iK9ZBiFXZCBlQdRX9RrbFDZXb3qvaExcNLGzma5EhP ClvC9j1oYwN1kIcc9VWVZJidz/IJQ4xPN9XGT6SPb5SqnxnU6xhMm67wvgmgAASNJT0Y 2eC6PdCGRdLwnEhxn3Qs7XB0qDQ6eWcM0bLim9SgnEFNq4L0aQSJ2DA9v1uMYvdgk1Ym g8bD6w0zSbM31V8pyc//1zRZslXJlUpXiGeU6iVufG8CfSOMcR4fWfp00UQEnMyUhxJd 5ItA== X-Gm-Message-State: AOAM531pNu+bbwOwg3wkonDnnL1UDwCDsXFYzElwFvRUzLZ7PTxiQ78d H8Z4yFbOqbo9ufuzRn854sJW4wAqD7w= X-Google-Smtp-Source: ABdhPJzUCwMeqhLfHREAbMKD8TxAFJjaregyIACNWUCC5Q86WEIt8ImTFyAu8WonyYinJxeYO8p8Vg== X-Received: by 2002:a17:902:ea0a:b0:13a:6d2d:d2f with SMTP id s10-20020a170902ea0a00b0013a6d2d0d2fmr4607793plg.76.1631416529203; Sat, 11 Sep 2021 20:15:29 -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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 20:15:28 -0700 (PDT) From: Bin Meng To: Simon Glass , Rick Chen , Leo Yu-Chi Liang , u-boot@lists.denx.de Subject: [PATCH 3/9] gpio: sifive: Fix -Wint-to-pointer-cast warning Date: Sun, 12 Sep 2021 11:15:10 +0800 Message-Id: <20210912031516.24885-3-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 dev_read_addr() returns a value of type fdt_addr_t which is a 64-bit address and plat->base is a pointer. In a 32-bit build, this causes the following warning seen when building sifive-gpio.c: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Change to use dev_read_addr_ptr(). Signed-off-by: Bin Meng Reviewed-by: Leo Yu-Chi Liang --- drivers/gpio/sifive-gpio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/sifive-gpio.c b/drivers/gpio/sifive-gpio.c index abd1f629b9..151f484e8f 100644 --- a/drivers/gpio/sifive-gpio.c +++ b/drivers/gpio/sifive-gpio.c @@ -157,13 +157,11 @@ static const struct dm_gpio_ops sifive_gpio_ops = { static int sifive_gpio_of_to_plat(struct udevice *dev) { struct sifive_gpio_plat *plat = dev_get_plat(dev); - fdt_addr_t addr; - addr = dev_read_addr(dev); - if (addr == FDT_ADDR_T_NONE) + plat->base = dev_read_addr_ptr(dev); + if (!plat->base) return -EINVAL; - plat->base = (void *)addr; return 0; } From patchwork Sun Sep 12 03:15:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1526817 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=Zu8Aw+i1; 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 4H6ZWc2PVWz9sVw for ; Sun, 12 Sep 2021 13:16:12 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5A6A4838DE; Sun, 12 Sep 2021 05:15:49 +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="Zu8Aw+i1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CD1FB838D7; Sun, 12 Sep 2021 05:15:37 +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-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) (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 18E81838D7 for ; Sun, 12 Sep 2021 05:15:33 +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-x534.google.com with SMTP id h3so5907775pgb.7 for ; Sat, 11 Sep 2021 20:15:33 -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=SAYPew3ncfgitBKgrGDNuQfYoqB7aJjxmhSP+ikJU/U=; b=Zu8Aw+i1ue5Ygr+KneseuLUup+YetgE6TZCHDV/kP+IC/1d82OJlQxZVadlH0Sk+Kt aOozYSma8brnh9NA51sPpCuSs/6mYklnB80ZOBd58vdbZ9K7fv6kuiKQzrEn1y3Kl49D g30W0eDvZu60g9hFuVik6uHLYH1wUQYOY0CdmaQwYgV1C8chrzugZFfhPsxIYXNIZs9C 4HR9lpqcgm5rHGhDd59bGnUS3nOmhvFUZ4A7pciYDaXxh4x/noDHUIZ+fT6xVt/BYfkz 5HtfIVUXRCrd/GQLKFMS3KCOS/qfnMNcike2yu9aKaaPeFxFbDOzAcoBn2mT1vfSZSja 1gpw== 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=SAYPew3ncfgitBKgrGDNuQfYoqB7aJjxmhSP+ikJU/U=; b=pEMLS3abH26AT41Og39MHFbKAY3sCFaC5guFL41y30HtsKl1neZUiBLaiHDlOforQP gmzhhmkIy+iXJnyYLyP+v8J7pyaqmgV+xTZYW98BdEYsgqQDsVTK9swX/UKzpfdqA/wz hSo2xCzT9BrF97ejVLngIH1o0KBzXzT1zEe0aNHmdxrsmfy1WNuH49FbMeCdLqKdRoTq Y5dRP0pTiE8SWpNhKm/ibGT7z9fLLKMTyM4jvo4NwySGQE7WXTyB+JOym8BFuI8Q18m5 q5gbGG7TaWkgVxbQeFRTwiNQJUR1gHTKrkwses5QOByRJYwRmQNhnjZsSNp5gjbhJmtz 15Fg== X-Gm-Message-State: AOAM533U0lwd/c/2bD0hiCyENdEDS2wp4fyG1cDSkN6iMRGpYv7w2CCf HHX0BYLLTsF+y38bHOaRSz3mn9Afy/Q= X-Google-Smtp-Source: ABdhPJy8n8guRDXJuuy/Ru+nNHzJg0fHBAE8zcVXRoxZyvDNL4OslIqnF6In1HnB5RTfPKUakDezCA== X-Received: by 2002:a63:9546:: with SMTP id t6mr4960588pgn.260.1631416531483; Sat, 11 Sep 2021 20:15:31 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 20:15:31 -0700 (PDT) From: Bin Meng To: Simon Glass , Rick Chen , Leo Yu-Chi Liang , u-boot@lists.denx.de Subject: [PATCH 4/9] i2c: ocores: Fix -Wint-to-pointer-cast warning Date: Sun, 12 Sep 2021 11:15:11 +0800 Message-Id: <20210912031516.24885-4-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 ocores_i2c.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_ptr(). Signed-off-by: Bin Meng Reviewed-by: Leo Yu-Chi Liang --- drivers/i2c/ocores_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/ocores_i2c.c b/drivers/i2c/ocores_i2c.c index f129ec3818..3b19ba78fa 100644 --- a/drivers/i2c/ocores_i2c.c +++ b/drivers/i2c/ocores_i2c.c @@ -516,7 +516,7 @@ static int ocores_i2c_probe(struct udevice *dev) u32 clock_frequency_khz; int ret; - bus->base = (void __iomem *)devfdt_get_addr(dev); + bus->base = dev_read_addr_ptr(dev); if (dev_read_u32(dev, "reg-shift", &bus->reg_shift)) { /* no 'reg-shift', check for deprecated 'regstep' */ From patchwork Sun Sep 12 03:15:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1526818 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=L7jHNmYr; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4H6ZWr5nyjz9sVw for ; Sun, 12 Sep 2021 13:16:24 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 23006838EE; Sun, 12 Sep 2021 05:15:54 +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="L7jHNmYr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1AD0F838E3; Sun, 12 Sep 2021 05:15:42 +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-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (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 71658838D6 for ; Sun, 12 Sep 2021 05:15:35 +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-x530.google.com with SMTP id k24so5890411pgh.8 for ; Sat, 11 Sep 2021 20:15:35 -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=jHUMgqCYGbslSlHH01vQ5nneDyeo/O8ITNHOyUe8RQ8=; b=L7jHNmYrRnsBBL6Owm6Q2V97N0bcU3Wm/hyZ/RxsD++mfRJ/qV8hsNeRnRR1bchVz3 c6WUrsbC2LCvGj6zwm1fAZZwIYGFx/C9WFR86KEbAnUIUhNJ3bsbu16pSX0pObd0omn2 K3aqDGhfj9LfV1Cr2sSTn8Go4T0bYcqwalbDKOCNLg21Mm1Cg1WPvjdT3fpLUVmiEPOz vs3+fH8a+E0371e45r7AfWoe976ziT7n2FhNU6ygyFUd4lGroNr4Mc8SHFP0B3t4xjst Loh98LZ047lqmEJ00caVjRM8SD1//yxZTE71+3Tw/ojkcYxaEW5HCKPEvax+g7/fY6FN tJ8w== 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=jHUMgqCYGbslSlHH01vQ5nneDyeo/O8ITNHOyUe8RQ8=; b=hEw7FHUE60bg33j7N/Llfi6kMi3yWryPWOhDPSESvlM7/4KKlTZCQAo0g737Ry8rEg XoHv5O15IUUfQUGQgoh2QQfsuT4t9KC+W3y+MuWL6uHKGDH+bSp0bHbGDtXlgVqTRIER DoUyVxq5ZivDpqBxeyqsiaaZr1fEMyDhw+7mGtMB9b4m6xi6NXgvfGz/7Oc2JWoiguDa pDYqGt1X3vb2HIioISI98SAwl6yV57TsGZC+bNIEb6x1PAgY3IjTQpA+kT0fgysVwGi0 e3Yd7zEl/Nk1tx32OAyJqsOjXO/IXiL4YTUEa8jjl5/eOHEiBzdDxd1ipV8TZPZQ+lOI 2i3w== X-Gm-Message-State: AOAM531gDOIRHazN0xmIcN2SCeZs3uqpiulgnAt/6ysNeKTsZT/hBHkL ENhdQHDA9zHf5YcJGslBcpY= X-Google-Smtp-Source: ABdhPJwMVSSXa59Mt/LAZ9G7CM8Fp4gmlueJcJgZ4vWkyzlC1vEURw+uW+UOt4v+C9pwHaoGQWYQfA== X-Received: by 2002:a05:6a00:16ca:b0:413:d3f7:646f with SMTP id l10-20020a056a0016ca00b00413d3f7646fmr4896440pfc.7.1631416533795; Sat, 11 Sep 2021 20:15:33 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 20:15:33 -0700 (PDT) From: Bin Meng To: Simon Glass , Rick Chen , Leo Yu-Chi Liang , u-boot@lists.denx.de Subject: [PATCH 5/9] dm: core: Add a new API devfdt_get_addr_index_ptr() Date: Sun, 12 Sep 2021 11:15:12 +0800 Message-Id: <20210912031516.24885-5-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 At present there is only devfdt_get_addr_ptr() which only returns the first pair in the 'reg' property. Add a new API devfdt_get_addr_index_ptr() to return the indexed pointer. Signed-off-by: Bin Meng Reviewed-by: Leo Yu-Chi Liang --- drivers/core/fdtaddr.c | 11 ++++++++--- include/dm/fdtaddr.h | 12 ++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/core/fdtaddr.c b/drivers/core/fdtaddr.c index 4ffbd6b2eb..8dbb06ab03 100644 --- a/drivers/core/fdtaddr.c +++ b/drivers/core/fdtaddr.c @@ -93,6 +93,13 @@ fdt_addr_t devfdt_get_addr_index(const struct udevice *dev, int index) #endif } +void *devfdt_get_addr_index_ptr(const struct udevice *dev, int index) +{ + fdt_addr_t addr = devfdt_get_addr_index(dev, index); + + return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)(uintptr_t)addr; +} + fdt_addr_t devfdt_get_addr_size_index(const struct udevice *dev, int index, fdt_size_t *size) { @@ -155,9 +162,7 @@ fdt_addr_t devfdt_get_addr(const struct udevice *dev) void *devfdt_get_addr_ptr(const struct udevice *dev) { - fdt_addr_t addr = devfdt_get_addr_index(dev, 0); - - return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)(uintptr_t)addr; + return devfdt_get_addr_index_ptr(dev, 0); } void *devfdt_remap_addr_index(const struct udevice *dev, int index) diff --git a/include/dm/fdtaddr.h b/include/dm/fdtaddr.h index a4fda581a7..d2c1994291 100644 --- a/include/dm/fdtaddr.h +++ b/include/dm/fdtaddr.h @@ -92,6 +92,18 @@ void *devfdt_map_physmem(const struct udevice *dev, unsigned long size); */ fdt_addr_t devfdt_get_addr_index(const struct udevice *dev, int index); +/** + * devfdt_get_addr_index_ptr() - Return indexed pointer to the address of the + * reg property of a device + * + * @dev: Pointer to a device + * @index: the 'reg' property can hold a list of pairs + * and @index is used to select which one is required + * + * @return Pointer to addr, or NULL if there is no such property + */ +void *devfdt_get_addr_index_ptr(const struct udevice *dev, int index); + /** * devfdt_get_addr_size_index() - Get the indexed reg property of a device * From patchwork Sun Sep 12 03:15:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1526821 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=N9ABUgTe; 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 4H6ZXS4JHmz9sVw for ; Sun, 12 Sep 2021 13:16:56 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ED5F3838FF; Sun, 12 Sep 2021 05:16:05 +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="N9ABUgTe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9C99A838E6; 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-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (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 A08F8838E4 for ; Sun, 12 Sep 2021 05:15:37 +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-pj1-x102b.google.com with SMTP id m21-20020a17090a859500b00197688449c4so4140040pjn.0 for ; Sat, 11 Sep 2021 20:15:37 -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=4L3bsZII0hnbM/VH1B/MsJcuCO0tok1TQs880PhQQAU=; b=N9ABUgTeOl37Ud/ZT7swuT2IpdwJQcx0w1hem3vknQp1TKcO+KuOgEF8e+T4UYqErq nNrSK6TrmOLDDHQaC8uZxLySgub9CZZAgWOy1lYQZfRtsp2MQnnGXZOCqbuddl3RfZ1Q 7VqrInjmuEeyfpAuUyWb7Gg2UO2ao/GVBfOZpVyZxB7oVc7sx+om2S+MzgtqFUTzImZt 9ujhp4WsS29STvjIjVaMaSRH1VDYI38/EnjXhvPXXw1TCLQ/YLGcLfzTVvR577yaL4uF 5VRHjyd+Mnj9ig9ySqTPO1G3QZ1HEC9lzBZbpD0JyIxTcCsV5T7u/XLw3OO0D/PIq7tN x9tQ== 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=4L3bsZII0hnbM/VH1B/MsJcuCO0tok1TQs880PhQQAU=; b=vg4YKMgoJD4zfQJD2ekAVzHyz5BM3WJSLUN2UD454kT2o9s0sLpHqlJWWES/m4FK8M 4IFiEGpm2OyKmafWt00ucPmUvtlXT32tvIFcKHt/ZdHgZQ2Mazx/68FWF1P1pJS0f6Yl hhtXl4drml1WKAP3rI6tL8p2s/YOqjDwl3DOomfg2cKCvV+zxN/Sb1GipTK3/LU6IbW8 8LedMg/UkM6cQAkSuaMf7eZlVPTdICguYXQ741sY6gPhHqpRosESGXJhixN+TY/yTIfi TDetsmVmro389XVwmURBMRuiNmRwSbFytHd6iaEcDa5x4pv/TZ8KO3PlqSa7QIAPHboj mCFg== X-Gm-Message-State: AOAM530XxKUGj6W00OtEylLWJVydRs0GGteM8lTSHWzXpzNDBgTct8Im sxicKtz3DYt/k7MTznUlDmPE+Wzx2ls= X-Google-Smtp-Source: ABdhPJxj2PHiRvVJbdlyGXyjN4Op9CcKpZgGsE5XzIcy0O/Jey5waGyfXrIresbXoO4a2TfFM5nmWA== X-Received: by 2002:a17:902:9a91:b0:138:efd5:7302 with SMTP id w17-20020a1709029a9100b00138efd57302mr4643041plp.35.1631416536055; Sat, 11 Sep 2021 20:15:36 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 20:15:35 -0700 (PDT) From: Bin Meng To: Simon Glass , Rick Chen , Leo Yu-Chi Liang , u-boot@lists.denx.de Subject: [PATCH 6/9] dm: Provide dev_read_addr_index_ptr() wrapper Date: Sun, 12 Sep 2021 11:15:13 +0800 Message-Id: <20210912031516.24885-6-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 Like dev_read_addr_ptr(), provide a wrapper for the indexed version. Signed-off-by: Bin Meng Reviewed-by: Leo Yu-Chi Liang Reviewed-by: Simon Glass --- include/dm/read.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/dm/read.h b/include/dm/read.h index 5bf3405614..890bf3d847 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -180,6 +180,18 @@ int dev_read_size(const struct udevice *dev, const char *propname); */ fdt_addr_t dev_read_addr_index(const struct udevice *dev, int index); +/** + * dev_read_addr_index_ptr() - Get the indexed reg property of a device + * as a pointer + * + * @dev: Device to read from + * @index: the 'reg' property can hold a list of pairs + * and @index is used to select which one is required + * + * @return pointer or NULL if not found + */ +void *dev_read_addr_index_ptr(const struct udevice *dev, int index); + /** * dev_read_addr_size_index() - Get the indexed reg property of a device * @@ -805,6 +817,12 @@ static inline fdt_addr_t dev_read_addr_index(const struct udevice *dev, return devfdt_get_addr_index(dev, index); } +static inline void *dev_read_addr_index_ptr(const struct udevice *dev, + int index) +{ + return devfdt_get_addr_index_ptr(dev, index); +} + static inline fdt_addr_t dev_read_addr_size_index(const struct udevice *dev, int index, fdt_size_t *size) From patchwork Sun Sep 12 03:15:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1526819 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=L6jZ/CWV; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4H6ZX46ysdz9sVw for ; Sun, 12 Sep 2021 13:16:36 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 75400838F3; Sun, 12 Sep 2021 05:15:57 +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="L6jZ/CWV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2ECB0838E6; Sun, 12 Sep 2021 05:15:45 +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-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) (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 D693D838D7 for ; Sun, 12 Sep 2021 05:15:39 +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-pj1-x102f.google.com with SMTP id c13-20020a17090a558d00b00198e6497a4fso4199148pji.4 for ; Sat, 11 Sep 2021 20:15:39 -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=KKPgUwiYEqCOrKihBj1eOVofM1SDpWrBPw7a1aWSYWo=; b=L6jZ/CWVxOZrXJVFVAEWcyie9TQnRk5S+eSD9fpSKEoPknr6epits/SAc8eO4pEwcC WVMBmfIPpK8RfBKn61Jt/DXvgoa0rUyrCiWw6RTOwNgfzGYjID20WsOGa5DKJUy2wGXS +0WjosJJei9HWYVe8cILNJADF/Ejk244ICcUYUTSlUEnBi7nyph+xwkB6XdjYP50gbA5 GuqZCPkjSE1XYmfX24C16Km6jbi2BzfiV+RBXsg8Qg/lFb66kmc4zErY1Dw+I+t7yra/ uZc9/xcFEjgaXVv5wZL/rYAx2ttdL6BajJNSzuIGl5mpoYAxGLNM+C3FDEg9F6cke/fx XPbQ== 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=KKPgUwiYEqCOrKihBj1eOVofM1SDpWrBPw7a1aWSYWo=; b=ogp2/VQSPHqR3fzGkwR7ErjJuf1iWLyp2XqKrRhQ2AGlybN5KEqKCWycWpIN0mWHAR rftE56z6UZehCiH+dg9I2Vw9ISB6oOdcfpvPgcdD3kq8wC1+vjariNCxeIwu0v7U2VjS 113wxtnTfVEBU+HXXZbLea9jBpcMsc31y2OoD+6elwqyOkZC6cD9AW4t9VLV94fbTYEt Y1hnMR+C2lllt77o/yazyc9ouZL8tqt/ehtCAx5O8042WZ/crFziwDePluB340Xw/aHs NUT+oHosdQ93JgOolRTU+gEa1EMNhqLKT/wWGgFiMBSqGentXKvIQ2BucG+b1tDCPu4N uA+w== X-Gm-Message-State: AOAM531WiL4zueBIWCGDzRMYI2WOI9BBtn/G+9xf5a+FvPZE7oq3Kin7 WvO0CrhlT6FpqGyo2mIgDBld9BlVjEg= X-Google-Smtp-Source: ABdhPJxJ+3wyMu62l5Ab2FsCPm2dizZulfrP+s8jq8slD17PVMIHK4qrobqBYE/kvRrdlc3L5NT5iA== X-Received: by 2002:a17:90a:b881:: with SMTP id o1mr5640549pjr.141.1631416538316; Sat, 11 Sep 2021 20:15:38 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 20:15:38 -0700 (PDT) From: Bin Meng To: Simon Glass , Rick Chen , Leo Yu-Chi Liang , u-boot@lists.denx.de Subject: [PATCH 7/9] net: macb: Fix -Wint-to-pointer-cast warnings Date: Sun, 12 Sep 2021 11:15:14 +0800 Message-Id: <20210912031516.24885-7-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 macb.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(), or cast with uintptr_t. Signed-off-by: Bin Meng Reviewed-by: Ramon Fried --- drivers/net/macb.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 57ea45e2dc..fe14027b31 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -574,14 +574,9 @@ static int macb_phy_find(struct macb_device *macb, const char *name) #ifdef CONFIG_DM_ETH static int macb_sifive_clk_init(struct udevice *dev, ulong rate) { - fdt_addr_t addr; void *gemgxl_regs; - addr = dev_read_addr_index(dev, 1); - if (addr == FDT_ADDR_T_NONE) - return -ENODEV; - - gemgxl_regs = (void __iomem *)addr; + gemgxl_regs = dev_read_addr_index_ptr(dev, 1); if (!gemgxl_regs) return -ENODEV; @@ -1383,7 +1378,7 @@ static int macb_eth_probe(struct udevice *dev) macb->phy_addr = ofnode_read_u32_default(phandle_args.node, "reg", -1); - macb->regs = (void *)pdata->iobase; + macb->regs = (void *)(uintptr_t)pdata->iobase; macb->is_big_endian = (cpu_to_be32(0x12345678) == 0x12345678); @@ -1444,7 +1439,7 @@ static int macb_eth_of_to_plat(struct udevice *dev) { struct eth_pdata *pdata = dev_get_plat(dev); - pdata->iobase = (phys_addr_t)dev_remap_addr(dev); + pdata->iobase = (uintptr_t)dev_remap_addr(dev); if (!pdata->iobase) return -EINVAL; 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 From patchwork Sun Sep 12 03:15:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1526822 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=doZ/GvnT; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4H6ZXd3kkZz9sVw for ; Sun, 12 Sep 2021 13:17:05 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D687D83904; Sun, 12 Sep 2021 05:16:09 +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="doZ/GvnT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 26B37838D7; Sun, 12 Sep 2021 05:15:49 +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-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) (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 8C452838E3 for ; Sun, 12 Sep 2021 05:15:44 +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-pf1-x436.google.com with SMTP id x7so5569637pfa.8 for ; Sat, 11 Sep 2021 20:15:44 -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=MwuOPuKJIbXUd1Wt1KvEh/e3SlA5R0QJ0kJN0rPGx2s=; b=doZ/GvnT4eeACu8y/CbR42aL94Aa0uNuhluMfpp5Rchri6K/pk7mZe65c/PKp1r164 pjq5scNqLXH4daR9SH3HcNvN18ZFYTMd0XZ3BTgEnsN5Tn0J6RAV/VflzZUiq1sZRudo RFUSKAXyVbaCMQ2NWSlAl+q0LrIKeDH8fZue1I88G4D/5i4kggSc8o04TmgRkf/4oBu2 6j7kyKFUikZbnp6oN5b6cOokPzuIy9YcuCPAXl2ycsiVMBUHC1yW9woQDeAZW8U40AqG 8e7FR1XbtddHvFOt6egfYAHabm9YR8SU1SR0FYuQnumDNjWkGH9fAH5G3y3bLMnWTZCq XomA== 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=MwuOPuKJIbXUd1Wt1KvEh/e3SlA5R0QJ0kJN0rPGx2s=; b=DdyHO4jIBi+zqtpeei2XjK3SqN2kfSkaz9xlU7J0Sz3P2pFW2k4YnfNRODgrhXTHv3 YrXvW3Kb6LUXcjGgYFlTrXQ3X6KBFvRvdI7smj4XnOAw2Y5GI1dT18bCkDc31FYLlZJt uEui1dKCzWyVSHzDEljE5NNiso67dlVK7cNb+LSAph9FMLWBQ5zWk0z1jLaka3K+bT7g 1pAlccJ+G420t+V+ByBeuoWsDr9+t+kBtMEGsn/lRnBB3xIOzoqe16t2IA+XOrcBXbTn fu8X2/dSPWxsERMmuhzYoDi9bMqFfdNEQmGcSHPjfKyoQZ+CAoyReY025E+crqFhP76L NtDw== X-Gm-Message-State: AOAM532NgyFeUyoJGPx6E7dua9ykaGX5h+VjXKhWKgbniKCIEYMlNM7m G0kvtIsV7dgpgHRWQlNm+TM= X-Google-Smtp-Source: ABdhPJxunw9n76xj5PUBVNm8ZBOwBIJGpIOA2ucZuLq8EVg41/zMHvr9k5lpcUxb6LWKtYLK4vDByA== X-Received: by 2002:aa7:9243:0:b0:415:7304:7a8 with SMTP id 3-20020aa79243000000b00415730407a8mr4836277pfp.29.1631416543036; Sat, 11 Sep 2021 20:15:43 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 20:15:42 -0700 (PDT) From: Bin Meng To: Simon Glass , Rick Chen , Leo Yu-Chi Liang , u-boot@lists.denx.de Subject: [PATCH 9/9] board: sifive: Fix -Wint-to-pointer-cast warning Date: Sun, 12 Sep 2021 11:15:16 +0800 Message-Id: <20210912031516.24885-9-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 unleashed.c in a 32-bit build: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Cast with uintptr_t. Signed-off-by: Bin Meng Reviewed-by: Leo Yu-Chi Liang --- board/sifive/unleashed/unleashed.c | 2 +- board/sifive/unmatched/unmatched.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/board/sifive/unleashed/unleashed.c b/board/sifive/unleashed/unleashed.c index 33baeda986..e7d2332d8c 100644 --- a/board/sifive/unleashed/unleashed.c +++ b/board/sifive/unleashed/unleashed.c @@ -118,7 +118,7 @@ void *board_fdt_blob_setup(void) { if (IS_ENABLED(CONFIG_OF_SEPARATE)) { if (gd->arch.firmware_fdt_addr) - return (ulong *)gd->arch.firmware_fdt_addr; + return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr; } return (ulong *)&_end; diff --git a/board/sifive/unmatched/unmatched.c b/board/sifive/unmatched/unmatched.c index 8773b660fa..93c452c57f 100644 --- a/board/sifive/unmatched/unmatched.c +++ b/board/sifive/unmatched/unmatched.c @@ -15,7 +15,7 @@ void *board_fdt_blob_setup(void) { if (IS_ENABLED(CONFIG_OF_SEPARATE)) { if (gd->arch.firmware_fdt_addr) - return (ulong *)gd->arch.firmware_fdt_addr; + return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr; } return (ulong *)&_end;