Linux-Safety Archive on lore.kernel.org
 help / color / Atom feed
* [linux-safety] [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO
@ 2020-11-16 16:54 Sudip Mukherjee
  2020-11-16 17:01 ` Thierry Reding
  0 siblings, 1 reply; 4+ messages in thread
From: Sudip Mukherjee @ 2020-11-16 16:54 UTC (permalink / raw)
  To: Thierry Reding, Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas,
	Jonathan Hunter
  Cc: linux-kernel, linux-safety, linux-tegra, linux-pci, Sudip Mukherjee

Coccinelle suggested using PTR_ERR_OR_ZERO() and looking at the code,
we can use PTR_ERR_OR_ZERO() instead of checking IS_ERR() and then
doing 'return 0'.

Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
 drivers/pci/controller/pci-tegra.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c
index 8fcabed7c6a6..4c52b2d58645 100644
--- a/drivers/pci/controller/pci-tegra.c
+++ b/drivers/pci/controller/pci-tegra.c
@@ -1308,10 +1308,8 @@ static int tegra_pcie_resets_get(struct tegra_pcie *pcie)
 		return PTR_ERR(pcie->afi_rst);
 
 	pcie->pcie_xrst = devm_reset_control_get_exclusive(dev, "pcie_x");
-	if (IS_ERR(pcie->pcie_xrst))
-		return PTR_ERR(pcie->pcie_xrst);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(pcie->pcie_xrst);
 }
 
 static int tegra_pcie_phys_get_legacy(struct tegra_pcie *pcie)
-- 
2.11.0



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170): https://lists.elisa.tech/g/linux-safety/message/170
Mute This Topic: https://lists.elisa.tech/mt/78296400/5278000
Group Owner: linux-safety+owner@lists.elisa.tech
Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [linux-safety@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-safety] [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO
  2020-11-16 16:54 [linux-safety] [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO Sudip Mukherjee
@ 2020-11-16 17:01 ` Thierry Reding
  2020-11-23 14:51   ` Sudip Mukherjee
  0 siblings, 1 reply; 4+ messages in thread
From: Thierry Reding @ 2020-11-16 17:01 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Jonathan Hunter,
	linux-kernel, linux-safety, linux-tegra, linux-pci


[-- Attachment #1: Type: text/plain, Size: 957 bytes --]

On Mon, Nov 16, 2020 at 04:54:07PM +0000, Sudip Mukherjee wrote:
> Coccinelle suggested using PTR_ERR_OR_ZERO() and looking at the code,
> we can use PTR_ERR_OR_ZERO() instead of checking IS_ERR() and then
> doing 'return 0'.
> 
> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> ---
>  drivers/pci/controller/pci-tegra.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

This has been proposed multiple times in the past and Bjorn and I have
agreed every time that this is not an improvement, so sorry, but NAK.

Thierry


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#172): https://lists.elisa.tech/g/linux-safety/message/172
Mute This Topic: https://lists.elisa.tech/mt/78296400/5278000
Group Owner: linux-safety+owner@lists.elisa.tech
Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [linux-safety@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-safety] [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO
  2020-11-16 17:01 ` Thierry Reding
@ 2020-11-23 14:51   ` Sudip Mukherjee
  2020-11-23 15:01     ` Lukas Bulwahn
  0 siblings, 1 reply; 4+ messages in thread
From: Sudip Mukherjee @ 2020-11-23 14:51 UTC (permalink / raw)
  To: Thierry Reding, Sudip Mukherjee, Neil Armstrong
  Cc: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Jonathan Hunter,
	linux-kernel, linux-safety, linux-tegra, linux-pci


On 16/11/2020 17:01, Thierry Reding wrote:
> On Mon, Nov 16, 2020 at 04:54:07PM +0000, Sudip Mukherjee wrote:
>> Coccinelle suggested using PTR_ERR_OR_ZERO() and looking at the code,
>> we can use PTR_ERR_OR_ZERO() instead of checking IS_ERR() and then
>> doing 'return 0'.
>>
>> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
>> ---
>>  drivers/pci/controller/pci-tegra.c | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> This has been proposed multiple times in the past and Bjorn and I have
> agreed every time that this is not an improvement, so sorry, but NAK.

Thanks Thierry and Neil. I have now added a blacklist script in our CI
so "PTR_ERR_OR_ZERO" will not be flagged for anything in drivers/pci/*
anymore in our testing.



-- 
Regards
Sudip


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#189): https://lists.elisa.tech/g/linux-safety/message/189
Mute This Topic: https://lists.elisa.tech/mt/78296400/5278000
Group Owner: linux-safety+owner@lists.elisa.tech
Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [linux-safety@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-safety] [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO
  2020-11-23 14:51   ` Sudip Mukherjee
@ 2020-11-23 15:01     ` Lukas Bulwahn
  0 siblings, 0 replies; 4+ messages in thread
From: Lukas Bulwahn @ 2020-11-23 15:01 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Thierry Reding, Sudip Mukherjee, Neil Armstrong,
	Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Jonathan Hunter,
	Linux Kernel Mailing List, linux-safety, linux-tegra, linux-pci

On Mon, Nov 23, 2020 at 3:51 PM Sudip Mukherjee
<sudip.mukherjee@codethink.co.uk> wrote:
>
>
> On 16/11/2020 17:01, Thierry Reding wrote:
> > On Mon, Nov 16, 2020 at 04:54:07PM +0000, Sudip Mukherjee wrote:
> >> Coccinelle suggested using PTR_ERR_OR_ZERO() and looking at the code,
> >> we can use PTR_ERR_OR_ZERO() instead of checking IS_ERR() and then
> >> doing 'return 0'.
> >>
> >> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> >> ---
> >>  drivers/pci/controller/pci-tegra.c | 4 +---
> >>  1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > This has been proposed multiple times in the past and Bjorn and I have
> > agreed every time that this is not an improvement, so sorry, but NAK.
>
> Thanks Thierry and Neil. I have now added a blacklist script in our CI
> so "PTR_ERR_OR_ZERO" will not be flagged for anything in drivers/pci/*
> anymore in our testing.
>
>

Thanks, Sudip. I think that is a good idea to minimize churn on
subsystem maintainers from janitors.

We can continue to discuss how to share these settings on
ignore-rule-X-on-subsystem-Y with other "analysis tool CI
maintainers".

Lukas


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#190): https://lists.elisa.tech/g/linux-safety/message/190
Mute This Topic: https://lists.elisa.tech/mt/78296400/5278000
Group Owner: linux-safety+owner@lists.elisa.tech
Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [linux-safety@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 16:54 [linux-safety] [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO Sudip Mukherjee
2020-11-16 17:01 ` Thierry Reding
2020-11-23 14:51   ` Sudip Mukherjee
2020-11-23 15:01     ` Lukas Bulwahn

Linux-Safety Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-safety/0 linux-safety/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-safety linux-safety/ https://lore.kernel.org/linux-safety \
		linux-safety@lists.elisa.tech
	public-inbox-index linux-safety

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/tech.elisa.lists.linux-safety


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git