PCI: dwc: fix a warning about variable 'res' is uninitialized
Subsystems (2)
PATCH 1/1 PCI: dwc: fix a warning about variable 'res' is uninitialized
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.
--- drivers/pci/controller/dwc/pci-keystone.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/pci-keystone.c +2 -2
@@ -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);
Signature · 1 line
2.25.0
Quoted 12 lines · Dejin Zheng
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 todevm_platform_ioremap_resource_byname()") did a wrong conversion for keystone driver. the commit usedevm_platform_ioremap_resource_byname()to replaceplatform_get_resource_byname()anddevm_ioremap_resource(). but the subsequent code needs to use the variable 'res', which is got byplatform_get_resource_byname()for resource "app". so revert it.
Quoted 6 lines
Fixes c59a7d771134b5 ("PCI: dwc: Convert to devm_platform_ioremap_resource_byname()")Reported-by kernel test robot <[email protected]>Signed-off-by Dejin Zheng <[email protected]>--- drivers/pci/controller/dwc/pci-keystone.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Squashed in the commit it is fixing, thanks.
Lorenzo
Quoted 18 lines
drivers/pci/controller/dwc/pci-keystone.c +2
-2@@ -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);Signature · 1 line
2.25.0
Quoted 13 lines · Lorenzo Pieralisi
Quoted 12 lines · Dejin Zheng
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 todevm_platform_ioremap_resource_byname()") did a wrong conversion for keystone driver. the commit usedevm_platform_ioremap_resource_byname()to replaceplatform_get_resource_byname()anddevm_ioremap_resource(). but the subsequent code needs to use the variable 'res', which is got byplatform_get_resource_byname()for resource "app". so revert it.
Quoted 9 lines
Quoted 6 lines
Fixes c59a7d771134b5 ("PCI: dwc: Convert to devm_platform_ioremap_resource_byname()")Reported-by kernel test robot <[email protected]>Signed-off-by Dejin Zheng <[email protected]>--- drivers/pci/controller/dwc/pci-keystone.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Squashed in the commit it is fixing, thanks.
Lorenzo, Thanks a lot for your help.
BR,
Dejin
Quoted 20 lines
Lorenzo
Quoted 18 lines
drivers/pci/controller/dwc/pci-keystone.c +2
-2@@ -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);Signature · 1 line
2.25.0