From patchwork Wed Oct 11 14:02:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 115559 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp795747qgn; Wed, 11 Oct 2017 07:02:32 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBbGaFYsED69Ndxuoh5wfn1Rb6OrpfT5KNYcn1vxhYx17kPHCtgT0uSRMPmljSzLWgKeSln X-Received: by 10.101.80.133 with SMTP id r5mr15231694pgp.183.1507730552742; Wed, 11 Oct 2017 07:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507730552; cv=none; d=google.com; s=arc-20160816; b=aN8fC1fty0eYB/vJApHTY3O1xxjCbQ1+NE/YzmUFcNog83cCQi+Yv7U3MyHALovI4i DkgCC9ttWMmAxf+Ifoiqt1f2EfxcEGnpFHpbeYvzWBGK7s1H4qBjleYRJCluAZ6aDwgF isLtgso+zBYbn7LJha1sX9hUs0TgYPNqU2cTAG1o0t0/jc3Q9VFmTorXXYMr0gvl67hL X5F05HkITSukvsASw0iTRlRRoW4Y4sRnoP2IC6a9CBuJXrJQ+d+n0o+jHgLe31hQmP3f nm3r47w8FNj+OclawCG70OfHjxLwjJVhbFTZ990Ta2oBskDLIAylou2JLlRcy5pmtJ/O 0aFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Yivke1E1/Va5nTVy19Tl3yFXdCXM4kZOEuDCsH9q+MY=; b=Q0SSCzZW42v36Jz7tLD3nfpyS4Hu3JxFtDJA1aPSCva0IpSZexuvWkSKMUtmhal3pg mdeZm3N8RML68ITVH1uzcDid3NHEOL8AxySJKSNPxACX+FUfSWU8MVbZ4nHbeU7lrjDE o0Yq8k9+ZatLe2KELx3w+7XrK7UuM2kQdb5UL8ydA3gCcPp54eC31x1DTlcwVjobJSBT Cxc/RuWAHucYRCtbAt+eUFKYXL4r/2Jbh9PODSmttx7SNZ0e6+MCx5OW/bNNmrncsdk2 iLN/fxWgf+DR3uBX+XY6JfmaLYpA4gpDn5cHLgtPMzpdMvwcj0oLNFyV12/XO0SCHtC5 YQ7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y76si2270493pfd.136.2017.10.11.07.02.32; Wed, 11 Oct 2017 07:02:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757582AbdJKOCb (ORCPT + 27 others); Wed, 11 Oct 2017 10:02:31 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:50244 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751691AbdJKOC2 (ORCPT ); Wed, 11 Oct 2017 10:02:28 -0400 Received: from wuerfel.lan ([95.208.190.237]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.129]) with ESMTPA (Nemesis) id 0MSCWE-1dqmJH0uV8-00TGpM; Wed, 11 Oct 2017 16:02:25 +0200 From: Arnd Bergmann To: Linus Walleij , Bjorn Helgaas Cc: Arnd Bergmann , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PCI: v3-semi: print resources using %pR format string Date: Wed, 11 Oct 2017 16:02:09 +0200 Message-Id: <20171011140224.3770968-1-arnd@arndb.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/CmI9OHDVpDvRBKOK787WJ5H8uIdbg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A resource_size_t can be 32 or 64 bit on arm32, causing a number of warnings for incorrect format strings: In file included from include/linux/printk.h:327:0, from include/linux/kernel.h:13, from include/linux/interrupt.h:5, from drivers/pci/host/pci-v3-semi.c:19: drivers/pci/host/pci-v3-semi.c: In function 'v3_pci_setup_resource': drivers/pci/host/pci-v3-semi.c:536:4: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'phys_addr_t {aka long long unsigned int}' [-Werror=format=] "I/O window start %08x, bus addr %08x, size %08x\n", drivers/pci/host/pci-v3-semi.c:536:4: error: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'resource_size_t {aka long long unsigned int}' [-Werror=format=] The best way to print this instead is to pass the resource itself to printk as a pointerm, using the special '%pR' format string for pretty-printing the range. For the bus address, we use %pap, respectively. Fixes: 132d10e24ff3 ("PCI: v3-semi: Add V3 Semiconductor PCI host driver") Signed-off-by: Arnd Bergmann --- drivers/pci/host/pci-v3-semi.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) -- 2.9.0 Reviewed-by: Linus Walleij diff --git a/drivers/pci/host/pci-v3-semi.c b/drivers/pci/host/pci-v3-semi.c index a544d722aef1..02f6e1e3a421 100644 --- a/drivers/pci/host/pci-v3-semi.c +++ b/drivers/pci/host/pci-v3-semi.c @@ -532,10 +532,8 @@ static int v3_pci_setup_resource(struct v3_pci *v3, io->name = "V3 PCI I/O"; v3->io_mem = io_base; v3->io_bus_addr = io->start - win->offset; - dev_dbg(dev, - "I/O window start %08x, bus addr %08x, size %08x\n", - v3->io_mem, v3->io_bus_addr, - resource_size(io)); + dev_dbg(dev, "I/O window %pR, bus addr %pap\n", + io, &v3->io_bus_addr); ret = pci_remap_iospace(io, io_base); if (ret) { dev_warn(dev, @@ -556,9 +554,8 @@ static int v3_pci_setup_resource(struct v3_pci *v3, mem->name = "V3 PCI PRE-MEM"; v3->pre_mem = mem->start; v3->pre_bus_addr = mem->start - win->offset; - dev_dbg(dev, "PREFETCHABLE MEM window start %08x, bus addr %08x, size %08x\n", - v3->pre_mem, v3->pre_bus_addr, - resource_size(mem)); + dev_dbg(dev, "PREFETCHABLE MEM window %pR, bus addr %pap\n", + mem, &v3->pre_bus_addr); if (resource_size(mem) != SZ_256M) { dev_err(dev, "prefetchable memory range is not 256MB\n"); return -EINVAL; @@ -582,10 +579,8 @@ static int v3_pci_setup_resource(struct v3_pci *v3, mem->name = "V3 PCI NON-PRE-MEM"; v3->non_pre_mem = mem->start; v3->non_pre_bus_addr = mem->start - win->offset; - dev_dbg(dev, - "NON-PREFETCHABLE MEM window start %08x, bus addr %08x, size %08x\n", - v3->non_pre_mem, v3->non_pre_bus_addr, - resource_size(mem)); + dev_dbg(dev, "NON-PREFETCHABLE MEM window %pR, bus addr %pap\n", + mem, &v3->non_pre_bus_addr); if (resource_size(mem) != SZ_256M) { dev_err(dev, "non-prefetchable memory range is not 256MB\n"); @@ -602,7 +597,7 @@ static int v3_pci_setup_resource(struct v3_pci *v3, } break; case IORESOURCE_BUS: - dev_dbg(dev, "BUS %d\n", win->res->start); + dev_dbg(dev, "BUS %pR\n", win->res); host->busnr = win->res->start; break; default: @@ -781,9 +776,8 @@ static int v3_pci_probe(struct platform_device *pdev) * as the physical memory we've remapped it from. */ if (readl(v3->base + V3_LB_IO_BASE) != (regs->start >> 16)) - dev_err(dev, "V3_LB_IO_BASE = %08x but device is @%08x\n", - readl(v3->base + V3_LB_IO_BASE), - regs->start); + dev_err(dev, "V3_LB_IO_BASE = %08x but device is @%pR\n", + readl(v3->base + V3_LB_IO_BASE), regs); /* Configuration space is 16MB directly mapped */ regs = platform_get_resource(pdev, IORESOURCE_MEM, 1);