From: Dejin Zheng <zhengdejin5@gmail.com>
To: m-karicheri2@ti.com, lorenzo.pieralisi@arm.com, robh@kernel.org,
bhelgaas@google.com, gustavo.pimentel@synopsys.com,
linux-pci@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Dejin Zheng <zhengdejin5@gmail.com>,
kernel test robot <lkp@intel.com>
Subject: [PATCH v1] PCI: dwc: fix a warning about variable 'res' is uninitialized
Date: Fri, 17 Jul 2020 21:30:07 +0800 [thread overview]
Message-ID: <20200717133007.23858-1-zhengdejin5@gmail.com> (raw)
The kernel test robot reported a compile warning,
drivers/pci/controller/dwc/pci-keystone.c:1236:18: warning: variable 'res'
is uninitialized when used here [-Wuninitialized]
The commit c59a7d771134b5 ("PCI: dwc: Convert to
devm_platform_ioremap_resource_byname()") did a wrong conversion for
keystone driver. the commit use devm_platform_ioremap_resource_byname()
to replace platform_get_resource_byname() and devm_ioremap_resource().
but the subsequent code needs to use the variable 'res', which is got by
platform_get_resource_byname() for resource "app". so revert it.
Fixes: c59a7d771134b5 ("PCI: dwc: Convert to devm_platform_ioremap_resource_byname()")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
---
drivers/pci/controller/dwc/pci-keystone.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c
index 5ffc3b40c4f6..00279002102e 100644
--- a/drivers/pci/controller/dwc/pci-keystone.c
+++ b/drivers/pci/controller/dwc/pci-keystone.c
@@ -1228,8 +1228,8 @@ static int __init ks_pcie_probe(struct platform_device *pdev)
if (!pci)
return -ENOMEM;
- ks_pcie->va_app_base =
- devm_platform_ioremap_resource_byname(pdev, "app");
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "app");
+ ks_pcie->va_app_base = devm_ioremap_resource(dev, res);
if (IS_ERR(ks_pcie->va_app_base))
return PTR_ERR(ks_pcie->va_app_base);
--
2.25.0
next reply other threads:[~2020-07-17 13:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-17 13:30 Dejin Zheng [this message]
2020-07-17 16:31 ` Lorenzo Pieralisi
2020-07-17 16:43 ` Dejin Zheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200717133007.23858-1-zhengdejin5@gmail.com \
--to=zhengdejin5@gmail.com \
--cc=bhelgaas@google.com \
--cc=gustavo.pimentel@synopsys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lkp@intel.com \
--cc=lorenzo.pieralisi@arm.com \
--cc=m-karicheri2@ti.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®