* [PATCH V3 1/3] PCI: tegra: add missing __iomem annotation
@ 2013-09-23 4:33 Jingoo Han
2013-09-23 4:35 ` [PATCH V3 2/3] PCI: mvebu: make local functions static Jingoo Han
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Jingoo Han @ 2013-09-23 4:33 UTC (permalink / raw)
To: 'Bjorn Helgaas'
Cc: 'Thierry Reding', linux-pci, 'Stephen Warren',
'Jingoo Han'
Added missing __iomem annotation in order to fix the following
sparse warnings:
drivers/pci/host/pci-tegra.c:411:41: warning: incorrect type in return expression (different address spaces)
drivers/pci/host/pci-tegra.c:411:41: expected void [noderef] <asn:2>*
drivers/pci/host/pci-tegra.c:411:41: got void *addr
drivers/pci/host/pci-tegra.c:419:25: warning: incorrect type in return expression (different address spaces)
drivers/pci/host/pci-tegra.c:419:25: expected void [noderef] <asn:2>*
drivers/pci/host/pci-tegra.c:419:25: got void *addr
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Thierry Reding <treding@nvidia.com>
---
drivers/pci/host/pci-tegra.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 2e9888a..7c4f38d 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -408,7 +408,7 @@ static void __iomem *tegra_pcie_bus_map(struct tegra_pcie *pcie,
list_for_each_entry(bus, &pcie->busses, list)
if (bus->nr == busnr)
- return bus->area->addr;
+ return (void __iomem *)bus->area->addr;
bus = tegra_pcie_bus_alloc(pcie, busnr);
if (IS_ERR(bus))
@@ -416,7 +416,7 @@ static void __iomem *tegra_pcie_bus_map(struct tegra_pcie *pcie,
list_add_tail(&bus->list, &pcie->busses);
- return bus->area->addr;
+ return (void __iomem *)bus->area->addr;
}
static void __iomem *tegra_pcie_conf_address(struct pci_bus *bus,
--
1.7.10.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH V3 2/3] PCI: mvebu: make local functions static
2013-09-23 4:33 [PATCH V3 1/3] PCI: tegra: add missing __iomem annotation Jingoo Han
@ 2013-09-23 4:35 ` Jingoo Han
2013-09-23 6:31 ` [PATCH V3 3/3] PCI: mvebu: return NULL instead of ERR_PTR(ret) Jingoo Han
2013-09-27 19:29 ` [PATCH V3 1/3] PCI: tegra: add missing __iomem annotation Bjorn Helgaas
2 siblings, 0 replies; 8+ messages in thread
From: Jingoo Han @ 2013-09-23 4:35 UTC (permalink / raw)
To: 'Bjorn Helgaas'
Cc: linux-pci, 'Thomas Petazzoni', 'Jason Cooper',
'Jingoo Han'
mvebu_pcie_add_bus(), mvebu_pcie_align_resource() are used only
in this file. Thus, these local functions should be staticized
in order to fix the following sparse warnings:
drivers/pci/host/pci-mvebu.c:684:6: warning: symbol 'mvebu_pcie_add_bus' was not declared. Should it be static?
drivers/pci/host/pci-mvebu.c:690:17: warning: symbol 'mvebu_pcie_align_resource' was not declared. Should it be static?
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
drivers/pci/host/pci-mvebu.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index 77f8a7c..0bd3ba8 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -681,17 +681,17 @@ static struct pci_bus *mvebu_pcie_scan_bus(int nr, struct pci_sys_data *sys)
return bus;
}
-void mvebu_pcie_add_bus(struct pci_bus *bus)
+static void mvebu_pcie_add_bus(struct pci_bus *bus)
{
struct mvebu_pcie *pcie = sys_to_pcie(bus->sysdata);
bus->msi = pcie->msi;
}
-resource_size_t mvebu_pcie_align_resource(struct pci_dev *dev,
- const struct resource *res,
- resource_size_t start,
- resource_size_t size,
- resource_size_t align)
+static resource_size_t mvebu_pcie_align_resource(struct pci_dev *dev,
+ const struct resource *res,
+ resource_size_t start,
+ resource_size_t size,
+ resource_size_t align)
{
if (dev->bus->number != 0)
return start;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH V3 3/3] PCI: mvebu: return NULL instead of ERR_PTR(ret)
2013-09-17 5:25 [PATCH V2 " Jingoo Han
@ 2013-09-23 4:35 ` Jingoo Han
2013-09-23 7:24 ` Thomas Petazzoni
0 siblings, 1 reply; 8+ messages in thread
From: Jingoo Han @ 2013-09-23 4:35 UTC (permalink / raw)
To: 'Bjorn Helgaas'
Cc: linux-pci, 'Thomas Petazzoni', 'Jason Cooper',
'Jingoo Han'
Return NULL instead of ERR_PTR(ret) in order to fix the following
sparse warning:
drivers/pci/host/pci-mvebu.c:744:31: warning: incorrect type in return expression (different address spaces)
drivers/pci/host/pci-mvebu.c:744:31: expected void [noderef] <asn:2>*
drivers/pci/host/pci-mvebu.c:744:31: got void *
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
drivers/pci/host/pci-mvebu.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index 0bd3ba8..fb2474f 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -741,7 +741,7 @@ static void __iomem *mvebu_pcie_map_registers(struct platform_device *pdev,
ret = of_address_to_resource(np, 0, ®s);
if (ret)
- return ERR_PTR(ret);
+ return NULL;
return devm_ioremap_resource(&pdev->dev, ®s);
}
@@ -940,10 +940,9 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
continue;
port->base = mvebu_pcie_map_registers(pdev, child, port);
- if (IS_ERR(port->base)) {
+ if (!port->base) {
dev_err(&pdev->dev, "PCIe%d.%d: cannot map registers\n",
port->port, port->lane);
- port->base = NULL;
clk_disable_unprepare(port->clk);
continue;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH V3 3/3] PCI: mvebu: return NULL instead of ERR_PTR(ret)
2013-09-23 4:33 [PATCH V3 1/3] PCI: tegra: add missing __iomem annotation Jingoo Han
2013-09-23 4:35 ` [PATCH V3 2/3] PCI: mvebu: make local functions static Jingoo Han
@ 2013-09-23 6:31 ` Jingoo Han
2013-10-15 9:12 ` Jingoo Han
2013-09-27 19:29 ` [PATCH V3 1/3] PCI: tegra: add missing __iomem annotation Bjorn Helgaas
2 siblings, 1 reply; 8+ messages in thread
From: Jingoo Han @ 2013-09-23 6:31 UTC (permalink / raw)
To: 'Bjorn Helgaas'
Cc: linux-pci, 'Thomas Petazzoni', 'Jason Cooper',
'Jingoo Han'
Return NULL instead of ERR_PTR(ret) in order to fix the following
sparse warning:
drivers/pci/host/pci-mvebu.c:744:31: warning: incorrect type in return expression (different address spaces)
drivers/pci/host/pci-mvebu.c:744:31: expected void [noderef] <asn:2>*
drivers/pci/host/pci-mvebu.c:744:31: got void *
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
drivers/pci/host/pci-mvebu.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index 0bd3ba8..fb2474f 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -741,7 +741,7 @@ static void __iomem *mvebu_pcie_map_registers(struct platform_device *pdev,
ret = of_address_to_resource(np, 0, ®s);
if (ret)
- return ERR_PTR(ret);
+ return NULL;
return devm_ioremap_resource(&pdev->dev, ®s);
}
@@ -940,10 +940,9 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
continue;
port->base = mvebu_pcie_map_registers(pdev, child, port);
- if (IS_ERR(port->base)) {
+ if (!port->base) {
dev_err(&pdev->dev, "PCIe%d.%d: cannot map registers\n",
port->port, port->lane);
- port->base = NULL;
clk_disable_unprepare(port->clk);
continue;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH V3 3/3] PCI: mvebu: return NULL instead of ERR_PTR(ret)
2013-09-23 4:35 ` [PATCH V3 3/3] PCI: mvebu: return NULL instead of ERR_PTR(ret) Jingoo Han
@ 2013-09-23 7:24 ` Thomas Petazzoni
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2013-09-23 7:24 UTC (permalink / raw)
To: Jingoo Han; +Cc: 'Bjorn Helgaas', linux-pci, 'Jason Cooper'
Dear Jingoo Han,
On Mon, 23 Sep 2013 13:35:42 +0900, Jingoo Han wrote:
> Return NULL instead of ERR_PTR(ret) in order to fix the following
> sparse warning:
>
> drivers/pci/host/pci-mvebu.c:744:31: warning: incorrect type in return expression (different address spaces)
> drivers/pci/host/pci-mvebu.c:744:31: expected void [noderef] <asn:2>*
> drivers/pci/host/pci-mvebu.c:744:31: got void *
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
--
Thomas Petazzoni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH V3 1/3] PCI: tegra: add missing __iomem annotation
2013-09-23 4:33 [PATCH V3 1/3] PCI: tegra: add missing __iomem annotation Jingoo Han
2013-09-23 4:35 ` [PATCH V3 2/3] PCI: mvebu: make local functions static Jingoo Han
2013-09-23 6:31 ` [PATCH V3 3/3] PCI: mvebu: return NULL instead of ERR_PTR(ret) Jingoo Han
@ 2013-09-27 19:29 ` Bjorn Helgaas
2 siblings, 0 replies; 8+ messages in thread
From: Bjorn Helgaas @ 2013-09-27 19:29 UTC (permalink / raw)
To: Jingoo Han; +Cc: Thierry Reding, linux-pci@vger.kernel.org, Stephen Warren
On Sun, Sep 22, 2013 at 10:33 PM, Jingoo Han <jg1.han@samsung.com> wrote:
> Added missing __iomem annotation in order to fix the following
> sparse warnings:
>
> drivers/pci/host/pci-tegra.c:411:41: warning: incorrect type in return expression (different address spaces)
> drivers/pci/host/pci-tegra.c:411:41: expected void [noderef] <asn:2>*
> drivers/pci/host/pci-tegra.c:411:41: got void *addr
> drivers/pci/host/pci-tegra.c:419:25: warning: incorrect type in return expression (different address spaces)
> drivers/pci/host/pci-tegra.c:419:25: expected void [noderef] <asn:2>*
> drivers/pci/host/pci-tegra.c:419:25: got void *addr
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> Acked-by: Thierry Reding <treding@nvidia.com>
Applied to my pci/host-tegra branch for v3.13. Thanks!
Bjorn
> ---
> drivers/pci/host/pci-tegra.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
> index 2e9888a..7c4f38d 100644
> --- a/drivers/pci/host/pci-tegra.c
> +++ b/drivers/pci/host/pci-tegra.c
> @@ -408,7 +408,7 @@ static void __iomem *tegra_pcie_bus_map(struct tegra_pcie *pcie,
>
> list_for_each_entry(bus, &pcie->busses, list)
> if (bus->nr == busnr)
> - return bus->area->addr;
> + return (void __iomem *)bus->area->addr;
>
> bus = tegra_pcie_bus_alloc(pcie, busnr);
> if (IS_ERR(bus))
> @@ -416,7 +416,7 @@ static void __iomem *tegra_pcie_bus_map(struct tegra_pcie *pcie,
>
> list_add_tail(&bus->list, &pcie->busses);
>
> - return bus->area->addr;
> + return (void __iomem *)bus->area->addr;
> }
>
> static void __iomem *tegra_pcie_conf_address(struct pci_bus *bus,
> --
> 1.7.10.4
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH V3 3/3] PCI: mvebu: return NULL instead of ERR_PTR(ret)
2013-09-23 6:31 ` [PATCH V3 3/3] PCI: mvebu: return NULL instead of ERR_PTR(ret) Jingoo Han
@ 2013-10-15 9:12 ` Jingoo Han
2013-10-17 13:04 ` Jason Cooper
0 siblings, 1 reply; 8+ messages in thread
From: Jingoo Han @ 2013-10-15 9:12 UTC (permalink / raw)
To: 'Jason Cooper'
Cc: 'Bjorn Helgaas', linux-pci, 'Thomas Petazzoni',
'Jason Cooper', 'Andrew Lunn',
'Gregory Clement', 'Jingoo Han'
On Monday, September 23, 2013 3:31 PM, Jingoo Han wrote:
>
> Return NULL instead of ERR_PTR(ret) in order to fix the following
> sparse warning:
>
> drivers/pci/host/pci-mvebu.c:744:31: warning: incorrect type in return expression (different address
> spaces)
> drivers/pci/host/pci-mvebu.c:744:31: expected void [noderef] <asn:2>*
> drivers/pci/host/pci-mvebu.c:744:31: got void *
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
(+cc Andrew Lunn, Gregory Clement)
Hi Jason Cooper,
Would you apply this patch into your 'linux-mvebu.git' tree?
It was already Acked by Thomas Petazzoni.
Also, it is a trivial change to fix sparse warning.
Thank you.
Best regards,
Jingoo Han
> ---
> drivers/pci/host/pci-mvebu.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
> index 0bd3ba8..fb2474f 100644
> --- a/drivers/pci/host/pci-mvebu.c
> +++ b/drivers/pci/host/pci-mvebu.c
> @@ -741,7 +741,7 @@ static void __iomem *mvebu_pcie_map_registers(struct platform_device *pdev,
>
> ret = of_address_to_resource(np, 0, ®s);
> if (ret)
> - return ERR_PTR(ret);
> + return NULL;
>
> return devm_ioremap_resource(&pdev->dev, ®s);
> }
> @@ -940,10 +940,9 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
> continue;
>
> port->base = mvebu_pcie_map_registers(pdev, child, port);
> - if (IS_ERR(port->base)) {
> + if (!port->base) {
> dev_err(&pdev->dev, "PCIe%d.%d: cannot map registers\n",
> port->port, port->lane);
> - port->base = NULL;
> clk_disable_unprepare(port->clk);
> continue;
> }
> --
> 1.7.10.4
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH V3 3/3] PCI: mvebu: return NULL instead of ERR_PTR(ret)
2013-10-15 9:12 ` Jingoo Han
@ 2013-10-17 13:04 ` Jason Cooper
0 siblings, 0 replies; 8+ messages in thread
From: Jason Cooper @ 2013-10-17 13:04 UTC (permalink / raw)
To: Jingoo Han
Cc: 'Bjorn Helgaas', linux-pci, 'Thomas Petazzoni',
'Andrew Lunn', 'Gregory Clement'
On Tue, Oct 15, 2013 at 06:12:07PM +0900, Jingoo Han wrote:
> On Monday, September 23, 2013 3:31 PM, Jingoo Han wrote:
> >
> > Return NULL instead of ERR_PTR(ret) in order to fix the following
> > sparse warning:
> >
> > drivers/pci/host/pci-mvebu.c:744:31: warning: incorrect type in return expression (different address
> > spaces)
> > drivers/pci/host/pci-mvebu.c:744:31: expected void [noderef] <asn:2>*
> > drivers/pci/host/pci-mvebu.c:744:31: got void *
> >
> > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> > Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>
> (+cc Andrew Lunn, Gregory Clement)
>
> Hi Jason Cooper,
>
> Would you apply this patch into your 'linux-mvebu.git' tree?
> It was already Acked by Thomas Petazzoni.
> Also, it is a trivial change to fix sparse warning.
> Thank you.
Applied to mvebu/drivers
thx,
Jason.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-10-17 13:04 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-23 4:33 [PATCH V3 1/3] PCI: tegra: add missing __iomem annotation Jingoo Han
2013-09-23 4:35 ` [PATCH V3 2/3] PCI: mvebu: make local functions static Jingoo Han
2013-09-23 6:31 ` [PATCH V3 3/3] PCI: mvebu: return NULL instead of ERR_PTR(ret) Jingoo Han
2013-10-15 9:12 ` Jingoo Han
2013-10-17 13:04 ` Jason Cooper
2013-09-27 19:29 ` [PATCH V3 1/3] PCI: tegra: add missing __iomem annotation Bjorn Helgaas
-- strict thread matches above, loose matches on Subject: below --
2013-09-17 5:25 [PATCH V2 " Jingoo Han
2013-09-23 4:35 ` [PATCH V3 3/3] PCI: mvebu: return NULL instead of ERR_PTR(ret) Jingoo Han
2013-09-23 7:24 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).