* [PATCH] PCI: exynos: simplify with PTR_ERR_OR_ZERO
@ 2020-09-03 9:05 Wei Xu
2020-09-03 12:29 ` Wei Xu
0 siblings, 1 reply; 2+ messages in thread
From: Wei Xu @ 2020-09-03 9:05 UTC (permalink / raw)
To: lorenzo.pieralisi, bhelgaas
Cc: xuwei5, linuxarm, shameerali.kolothum.thodi, jonathan.cameron,
john.garry, salil.mehta, shiju.jose, jinying, zhangyi.ac,
liguozhu, tangkunshan, huangdaode, Jingoo Han, Rob Herring,
Kukjin Kim, Krzysztof Kozlowski, linux-pci, linux-arm-kernel,
linux-samsung-soc, linux-kernel
Use PTR_ERR_OR_ZERO to make the code a little bit simpler.
This code was detected with the help of Coccinelle.
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
---
drivers/pci/controller/dwc/pci-exynos.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/pci/controller/dwc/pci-exynos.c b/drivers/pci/controller/dwc/pci-exynos.c
index 8d82c43..f59f027 100644
--- a/drivers/pci/controller/dwc/pci-exynos.c
+++ b/drivers/pci/controller/dwc/pci-exynos.c
@@ -90,10 +90,7 @@ static int exynos5440_pcie_get_mem_resources(struct platform_device *pdev,
return -ENOMEM;
ep->mem_res->elbi_base = devm_platform_ioremap_resource(pdev, 0);
- if (IS_ERR(ep->mem_res->elbi_base))
- return PTR_ERR(ep->mem_res->elbi_base);
-
- return 0;
+ return PTR_ERR_OR_ZERO(ep->mem_res->elbi_base);
}
static int exynos5440_pcie_get_clk_resources(struct exynos_pcie *ep)
--
2.8.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PCI: exynos: simplify with PTR_ERR_OR_ZERO
2020-09-03 9:05 [PATCH] PCI: exynos: simplify with PTR_ERR_OR_ZERO Wei Xu
@ 2020-09-03 12:29 ` Wei Xu
0 siblings, 0 replies; 2+ messages in thread
From: Wei Xu @ 2020-09-03 12:29 UTC (permalink / raw)
To: lorenzo.pieralisi, bhelgaas
Cc: linuxarm, shameerali.kolothum.thodi, jonathan.cameron,
john.garry, salil.mehta, shiju.jose, jinying, zhangyi.ac,
liguozhu, tangkunshan, huangdaode, Jingoo Han, Rob Herring,
Kukjin Kim, Krzysztof Kozlowski, linux-pci, linux-arm-kernel,
linux-samsung-soc, linux-kernel
Hi All,
Sorry for the noise and please ignore it.
I found these kind of changes have been sent and rejected before.
Best Regards,
Wei
On 2020/9/3 17:05, Wei Xu wrote:
> Use PTR_ERR_OR_ZERO to make the code a little bit simpler.
> This code was detected with the help of Coccinelle.
>
> Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
> ---
> drivers/pci/controller/dwc/pci-exynos.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pci-exynos.c b/drivers/pci/controller/dwc/pci-exynos.c
> index 8d82c43..f59f027 100644
> --- a/drivers/pci/controller/dwc/pci-exynos.c
> +++ b/drivers/pci/controller/dwc/pci-exynos.c
> @@ -90,10 +90,7 @@ static int exynos5440_pcie_get_mem_resources(struct platform_device *pdev,
> return -ENOMEM;
>
> ep->mem_res->elbi_base = devm_platform_ioremap_resource(pdev, 0);
> - if (IS_ERR(ep->mem_res->elbi_base))
> - return PTR_ERR(ep->mem_res->elbi_base);
> -
> - return 0;
> + return PTR_ERR_OR_ZERO(ep->mem_res->elbi_base);
> }
>
> static int exynos5440_pcie_get_clk_resources(struct exynos_pcie *ep)
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-03 15:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03 9:05 [PATCH] PCI: exynos: simplify with PTR_ERR_OR_ZERO Wei Xu
2020-09-03 12:29 ` Wei Xu
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).