* [PATCH] PCI: faraday: fix inconsistent IS_ERR and PTR_ERR
@ 2017-10-17 17:07 Gustavo A. R. Silva
2017-10-20 23:05 ` Bjorn Helgaas
0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2017-10-17 17:07 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: linux-pci, linux-kernel, Julia Lawall, Gustavo A. R. Silva
Fix inconsistent IS_ERR and PTR_ERR in faraday_pci_probe.
The proper pointer to be passed as argument is p->bus_clk.
This issue was detected with the help of Coccinelle.
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
This code was tested by compilation only.
drivers/pci/host/pci-ftpci100.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/host/pci-ftpci100.c b/drivers/pci/host/pci-ftpci100.c
index 06d9687..fae6bd1 100644
--- a/drivers/pci/host/pci-ftpci100.c
+++ b/drivers/pci/host/pci-ftpci100.c
@@ -463,7 +463,7 @@ static int faraday_pci_probe(struct platform_device *pdev)
}
p->bus_clk = devm_clk_get(dev, "PCICLK");
if (IS_ERR(p->bus_clk))
- return PTR_ERR(clk);
+ return PTR_ERR(p->bus_clk);
ret = clk_prepare_enable(p->bus_clk);
if (ret) {
dev_err(dev, "could not prepare PCICLK\n");
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PCI: faraday: fix inconsistent IS_ERR and PTR_ERR
2017-10-17 17:07 [PATCH] PCI: faraday: fix inconsistent IS_ERR and PTR_ERR Gustavo A. R. Silva
@ 2017-10-20 23:05 ` Bjorn Helgaas
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2017-10-20 23:05 UTC (permalink / raw)
To: Gustavo A. R. Silva; +Cc: Bjorn Helgaas, linux-pci, linux-kernel, Julia Lawall
On Tue, Oct 17, 2017 at 12:07:17PM -0500, Gustavo A. R. Silva wrote:
> Fix inconsistent IS_ERR and PTR_ERR in faraday_pci_probe.
> The proper pointer to be passed as argument is p->bus_clk.
>
> This issue was detected with the help of Coccinelle.
>
> Reported-by: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Huh, I merged the identical fix posted by Wei Yongjun 5 hours earlier :)
Thanks!
> ---
> This code was tested by compilation only.
>
> drivers/pci/host/pci-ftpci100.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/host/pci-ftpci100.c b/drivers/pci/host/pci-ftpci100.c
> index 06d9687..fae6bd1 100644
> --- a/drivers/pci/host/pci-ftpci100.c
> +++ b/drivers/pci/host/pci-ftpci100.c
> @@ -463,7 +463,7 @@ static int faraday_pci_probe(struct platform_device *pdev)
> }
> p->bus_clk = devm_clk_get(dev, "PCICLK");
> if (IS_ERR(p->bus_clk))
> - return PTR_ERR(clk);
> + return PTR_ERR(p->bus_clk);
> ret = clk_prepare_enable(p->bus_clk);
> if (ret) {
> dev_err(dev, "could not prepare PCICLK\n");
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-20 23:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-17 17:07 [PATCH] PCI: faraday: fix inconsistent IS_ERR and PTR_ERR Gustavo A. R. Silva
2017-10-20 23:05 ` Bjorn Helgaas
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).