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,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 605B7C47094 for ; Mon, 31 May 2021 08:49:22 +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 8EBFE61186 for ; Mon, 31 May 2021 08:49:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8EBFE61186 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 161C582D71; Mon, 31 May 2021 10:49:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.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=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="URcotd4u"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AF6D182E40; Mon, 31 May 2021 10:49:18 +0200 (CEST) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 7F59681CDE for ; Mon, 31 May 2021 10:49:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=narmstrong@baylibre.com Received: by mail-wr1-x435.google.com with SMTP id n2so10144171wrm.0 for ; Mon, 31 May 2021 01:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Cmoj99pwUQwzJ9scNbmwe2xcw8EiVmfKonMxtLtTWCI=; b=URcotd4uwZkpKMNUZDyXsx1V+wwWkbOspghkWsTw2JsKMPa6ZrCzj07/lHbkvj+fM4 kc6XwqR+fFlf/PsdMxNKDX569gK2LRDpw3VPjE5RYFkDsFAiVl3xUXgNzf26VG6Iog21 esnQCB3w8qA96dM9q3IpV5kxuUa1j738vsQEmnBtsix8sDBjihdDlxWEDHuAMA1GWfhC WIX+hVSTzkNfa7woO8csR7I+C6D5jjVQfh9UpOGtso9wqHrkoL/b53s+wMx+mD5RHMyt mIIsOqthl0oKarXAvyUC2XHN3YNzmGSiY8F9cTvUni5+WF5Y1dADwf5Zvvj8xUGjzved ADWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Cmoj99pwUQwzJ9scNbmwe2xcw8EiVmfKonMxtLtTWCI=; b=Y3Ek/hliO7/5DABfRXr+1kDgMu0xcdslx4t73KS33Y6csrXaSqai3fCncKM1uxKuA7 DfEEO/pUsnNrtyY9ko3bLu3AAr7uD7sW739gfvIVTsWqsTqjFoZEZb+AFgVeq1qMTaV3 J4Wcon+Ia+Fp+qejru4KBZVakGcDfiB/C9UzvGrqIQ+w+EryeXyxOO8/nXdfZh+Pgu3O 1xpH16R6hw2iiFdPxriIRDwWQy9ugWpeiXzpaYs4w0NtX9msrHvR4bYzxTJ8UzJOjQcN mwywYk40xHrOQqtdFXczBB8vrg87fjzskYQ1bVnzLt6yBG1kZ8i7H2Vrl+cwQr84Uu5i +t7w== X-Gm-Message-State: AOAM531CdP3YlHBZKish2bNIvItiAp/6OAxFRKSFkbVD6GkTeFL0dby3 2yIVxQ6N9bDidaJWC+HHDxMBwZlQpGA4rTHx X-Google-Smtp-Source: ABdhPJzfb1fL79u1WdlrfVZoPAjmYLq4ueLgSIM+cd92GIwPYg1I8YXsyURP+moa4kSh06rW01DWOw== X-Received: by 2002:a5d:64a3:: with SMTP id m3mr20839337wrp.172.1622450954740; Mon, 31 May 2021 01:49:14 -0700 (PDT) Received: from ?IPv6:2a01:e0a:90c:e290:6567:aa5c:6dc2:fff8? ([2a01:e0a:90c:e290:6567:aa5c:6dc2:fff8]) by smtp.gmail.com with ESMTPSA id m23sm3214868wml.27.2021.05.31.01.49.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 May 2021 01:49:14 -0700 (PDT) Subject: Re: [PATCH v2] drivers: pci: pcie_dw_common: fix Werror compilation error To: Green Wan Cc: bmeng.cn@gmail.com, ycliang@andestech.com, open list References: <20210519111616.306316-1-green.wan@sifive.com> From: Neil Armstrong Organization: Baylibre Message-ID: <9e3539cd-dc50-597f-dd81-8872db33d042@baylibre.com> Date: Mon, 31 May 2021 10:49:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210519111616.306316-1-green.wan@sifive.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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.102.4 at phobos.denx.de X-Virus-Status: Clean On 19/05/2021 13:16, Green Wan wrote: > Fix compilation error when Werror is turned on. The warning could > possible break some CI builds. > > Signed-off-by: Green Wan > --- > drivers/pci/pcie_dw_common.c | 54 +++++++++++++++++++----------------- > 1 file changed, 29 insertions(+), 25 deletions(-) > > diff --git a/drivers/pci/pcie_dw_common.c b/drivers/pci/pcie_dw_common.c > index 785fd3aad0..e66fb1490a 100644 > --- a/drivers/pci/pcie_dw_common.c > +++ b/drivers/pci/pcie_dw_common.c > @@ -213,7 +213,7 @@ int pcie_dw_read_config(const struct udevice *bus, pci_dev_t bdf, > > va_address = set_cfg_address(pcie, bdf, offset); > > - value = readl(va_address); > + value = readl((void __iomem *)va_address); > > debug("(addr,val)=(0x%04x, 0x%08lx)\n", offset, value); > *valuep = pci_conv_32_to_size(value, offset, size); > @@ -257,9 +257,9 @@ int pcie_dw_write_config(struct udevice *bus, pci_dev_t bdf, > > va_address = set_cfg_address(pcie, bdf, offset); > > - old = readl(va_address); > + old = readl((void __iomem *)va_address); > value = pci_conv_size_to_32(old, value, offset, size); > - writel(value, va_address); > + writel(value, (void __iomem *)va_address); > > return pcie_dw_prog_outbound_atu_unroll(pcie, PCIE_ATU_REGION_INDEX1, > PCIE_ATU_TYPE_IO, pcie->io.phys_start, > @@ -333,33 +333,37 @@ void pcie_dw_setup_host(struct pcie_dw *pci) > } > } > > - dev_dbg(pci->dev, "Config space: [0x%p - 0x%p, size 0x%llx]\n", > - pci->cfg_base, pci->cfg_base + pci->cfg_size, > - pci->cfg_size); > + dev_dbg(pci->dev, "Config space: [0x%llx - 0x%llx, size 0x%llx]\n", > + (u64)pci->cfg_base, (u64)pci->cfg_base + pci->cfg_size, > + (u64)pci->cfg_size); > > - dev_dbg(pci->dev, "IO space: [0x%llx - 0x%llx, size 0x%lx]\n", > - pci->io.phys_start, pci->io.phys_start + pci->io.size, > - pci->io.size); > + dev_dbg(pci->dev, "IO space: [0x%llx - 0x%llx, size 0x%llx]\n", > + (u64)pci->io.phys_start, (u64)pci->io.phys_start + pci->io.size, > + (u64)pci->io.size); > > - dev_dbg(pci->dev, "IO bus: [0x%lx - 0x%lx, size 0x%lx]\n", > - pci->io.bus_start, pci->io.bus_start + pci->io.size, > - pci->io.size); > + dev_dbg(pci->dev, "IO bus: [0x%llx - 0x%llx, size 0x%llx]\n", > + (u64)pci->io.bus_start, (u64)pci->io.bus_start + pci->io.size, > + (u64)pci->io.size); > > - dev_dbg(pci->dev, "MEM space: [0x%llx - 0x%llx, size 0x%lx]\n", > - pci->mem.phys_start, pci->mem.phys_start + pci->mem.size, > - pci->mem.size); > + dev_dbg(pci->dev, "MEM space: [0x%llx - 0x%llx, size 0x%llx]\n", > + (u64)pci->mem.phys_start, > + (u64)pci->mem.phys_start + pci->mem.size, > + (u64)pci->mem.size); > > - dev_dbg(pci->dev, "MEM bus: [0x%lx - 0x%lx, size 0x%lx]\n", > - pci->mem.bus_start, pci->mem.bus_start + pci->mem.size, > - pci->mem.size); > + dev_dbg(pci->dev, "MEM bus: [0x%llx - 0x%llx, size 0x%llx]\n", > + (u64)pci->mem.bus_start, > + (u64)pci->mem.bus_start + pci->mem.size, > + (u64)pci->mem.size); > > if (pci->prefetch.size) { > - dev_dbg(pci->dev, "PREFETCH space: [0x%llx - 0x%llx, size 0x%lx]\n", > - pci->prefetch.phys_start, pci->prefetch.phys_start + pci->prefetch.size, > - pci->prefetch.size); > - > - dev_dbg(pci->dev, "PREFETCH bus: [0x%lx - 0x%lx, size 0x%lx]\n", > - pci->prefetch.bus_start, pci->prefetch.bus_start + pci->prefetch.size, > - pci->prefetch.size); > + dev_dbg(pci->dev, "PREFETCH space: [0x%llx - 0x%llx, size 0x%llx]\n", > + (u64)pci->prefetch.phys_start, > + (u64)pci->prefetch.phys_start + pci->prefetch.size, > + (u64)pci->prefetch.size); > + > + dev_dbg(pci->dev, "PREFETCH bus: [0x%llx - 0x%llx, size 0x%llx]\n", > + (u64)pci->prefetch.bus_start, > + (u64)pci->prefetch.bus_start + pci->prefetch.size, > + (u64)pci->prefetch.size); > } > } > Reviewed-by: Neil Armstrong