* [PATCH] PCI: kirin: Use PTR_ERR_OR_ZERO() to simplify code
@ 2019-11-18 11:30 zhengbin
2019-11-18 12:46 ` Andrew Murray
0 siblings, 1 reply; 3+ messages in thread
From: zhengbin @ 2019-11-18 11:30 UTC (permalink / raw)
To: songxiaowei, wangbinghui, lorenzo.pieralisi, andrew.murray,
bhelgaas, linux-pci
Cc: zhengbin13
Fixes coccicheck warning:
drivers/pci/controller/dwc/pcie-kirin.c:141:1-3: WARNING: PTR_ERR_OR_ZERO can be used
drivers/pci/controller/dwc/pcie-kirin.c:177:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
drivers/pci/controller/dwc/pcie-kirin.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c
index c19617a..5b2131f 100644
--- a/drivers/pci/controller/dwc/pcie-kirin.c
+++ b/drivers/pci/controller/dwc/pcie-kirin.c
@@ -138,10 +138,7 @@ static long kirin_pcie_get_clk(struct kirin_pcie *kirin_pcie,
return PTR_ERR(kirin_pcie->apb_sys_clk);
kirin_pcie->pcie_aclk = devm_clk_get(dev, "pcie_aclk");
- if (IS_ERR(kirin_pcie->pcie_aclk))
- return PTR_ERR(kirin_pcie->pcie_aclk);
-
- return 0;
+ return PTR_ERR_OR_ZERO(kirin_pcie->pcie_aclk);
}
static long kirin_pcie_get_resource(struct kirin_pcie *kirin_pcie,
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI: kirin: Use PTR_ERR_OR_ZERO() to simplify code
2019-11-18 11:30 [PATCH] PCI: kirin: Use PTR_ERR_OR_ZERO() to simplify code zhengbin
@ 2019-11-18 12:46 ` Andrew Murray
2019-11-18 12:59 ` zhengbin (A)
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Murray @ 2019-11-18 12:46 UTC (permalink / raw)
To: zhengbin; +Cc: songxiaowei, wangbinghui, lorenzo.pieralisi, bhelgaas, linux-pci
On Mon, Nov 18, 2019 at 07:30:46PM +0800, zhengbin wrote:
> Fixes coccicheck warning:
>
> drivers/pci/controller/dwc/pcie-kirin.c:141:1-3: WARNING: PTR_ERR_OR_ZERO can be used
> drivers/pci/controller/dwc/pcie-kirin.c:177:1-3: WARNING: PTR_ERR_OR_ZERO can be used
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
> drivers/pci/controller/dwc/pcie-kirin.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c
> index c19617a..5b2131f 100644
> --- a/drivers/pci/controller/dwc/pcie-kirin.c
> +++ b/drivers/pci/controller/dwc/pcie-kirin.c
> @@ -138,10 +138,7 @@ static long kirin_pcie_get_clk(struct kirin_pcie *kirin_pcie,
> return PTR_ERR(kirin_pcie->apb_sys_clk);
>
> kirin_pcie->pcie_aclk = devm_clk_get(dev, "pcie_aclk");
> - if (IS_ERR(kirin_pcie->pcie_aclk))
> - return PTR_ERR(kirin_pcie->pcie_aclk);
> -
> - return 0;
> + return PTR_ERR_OR_ZERO(kirin_pcie->pcie_aclk);
> }
>
> static long kirin_pcie_get_resource(struct kirin_pcie *kirin_pcie,
Thanks for these patches. Though if you resend these next time you ought
to put them in a single patch series with a cover letter.
I'm not sure on the views of maintainers for other parts of the kernel
however for PCI this type of change has previously been rejected, see:
https://lkml.org/lkml/2019/5/31/535
I guess coccicheck isn't aware of this.
Thanks,
Andrew Murray
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI: kirin: Use PTR_ERR_OR_ZERO() to simplify code
2019-11-18 12:46 ` Andrew Murray
@ 2019-11-18 12:59 ` zhengbin (A)
0 siblings, 0 replies; 3+ messages in thread
From: zhengbin (A) @ 2019-11-18 12:59 UTC (permalink / raw)
To: Andrew Murray
Cc: songxiaowei, wangbinghui, lorenzo.pieralisi, bhelgaas, linux-pci
On 2019/11/18 20:46, Andrew Murray wrote:
> On Mon, Nov 18, 2019 at 07:30:46PM +0800, zhengbin wrote:
>> Fixes coccicheck warning:
>>
>> drivers/pci/controller/dwc/pcie-kirin.c:141:1-3: WARNING: PTR_ERR_OR_ZERO can be used
>> drivers/pci/controller/dwc/pcie-kirin.c:177:1-3: WARNING: PTR_ERR_OR_ZERO can be used
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: zhengbin <zhengbin13@huawei.com>
>> ---
>> drivers/pci/controller/dwc/pcie-kirin.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c
>> index c19617a..5b2131f 100644
>> --- a/drivers/pci/controller/dwc/pcie-kirin.c
>> +++ b/drivers/pci/controller/dwc/pcie-kirin.c
>> @@ -138,10 +138,7 @@ static long kirin_pcie_get_clk(struct kirin_pcie *kirin_pcie,
>> return PTR_ERR(kirin_pcie->apb_sys_clk);
>>
>> kirin_pcie->pcie_aclk = devm_clk_get(dev, "pcie_aclk");
>> - if (IS_ERR(kirin_pcie->pcie_aclk))
>> - return PTR_ERR(kirin_pcie->pcie_aclk);
>> -
>> - return 0;
>> + return PTR_ERR_OR_ZERO(kirin_pcie->pcie_aclk);
>> }
>>
>> static long kirin_pcie_get_resource(struct kirin_pcie *kirin_pcie,
> Thanks for these patches. Though if you resend these next time you ought
> to put them in a single patch series with a cover letter.
>
> I'm not sure on the views of maintainers for other parts of the kernel
> however for PCI this type of change has previously been rejected, see:
>
> https://lkml.org/lkml/2019/5/31/535
got that, thanks. please ignore other pci patches.
>
> I guess coccicheck isn't aware of this.
>
> Thanks,
>
> Andrew Murray
>
>> --
>> 2.7.4
>>
> .
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-18 12:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-18 11:30 [PATCH] PCI: kirin: Use PTR_ERR_OR_ZERO() to simplify code zhengbin
2019-11-18 12:46 ` Andrew Murray
2019-11-18 12:59 ` zhengbin (A)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.