From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34596C433F5 for ; Sun, 12 Sep 2021 03:16:35 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 665A960F9D for ; Sun, 12 Sep 2021 03:16:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 665A960F9D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de 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) 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 Content-Transfer-Encoding: 8bit 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 --- 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; -- 2.25.1