From: Sudip Mukherjee <sudipm.mukherjee@gmail.com> To: Thierry Reding <thierry.reding@gmail.com>, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Rob Herring <robh@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, Jonathan Hunter <jonathanh@nvidia.com> Cc: linux-kernel@vger.kernel.org, linux-safety@lists.elisa.tech, linux-tegra@vger.kernel.org, linux-pci@vger.kernel.org, Sudip Mukherjee <sudipm.mukherjee@gmail.com> Subject: [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO Date: Mon, 16 Nov 2020 16:54:07 +0000 [thread overview] Message-ID: <20201116165407.8050-1-sudipm.mukherjee@gmail.com> (raw) 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
WARNING: multiple messages have this Message-ID (diff)
From: "Sudip Mukherjee" <sudipm.mukherjee@gmail.com> To: Thierry Reding <thierry.reding@gmail.com>, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Rob Herring <robh@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, Jonathan Hunter <jonathanh@nvidia.com> Cc: linux-kernel@vger.kernel.org, linux-safety@lists.elisa.tech, linux-tegra@vger.kernel.org, linux-pci@vger.kernel.org, Sudip Mukherjee <sudipm.mukherjee@gmail.com> Subject: [linux-safety] [PATCH] PCI: tegra: Use PTR_ERR_OR_ZERO Date: Mon, 16 Nov 2020 16:54:07 +0000 [thread overview] Message-ID: <20201116165407.8050-1-sudipm.mukherjee@gmail.com> (raw) 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] -=-=-=-=-=-=-=-=-=-=-=-
next reply other threads:[~2020-11-16 16:56 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-11-16 16:54 Sudip Mukherjee [this message] 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-16 17:01 ` [linux-safety] " Thierry Reding 2020-11-23 14:51 ` Sudip Mukherjee 2020-11-23 14:51 ` Sudip Mukherjee 2020-11-23 15:01 ` Lukas Bulwahn 2020-11-23 15:01 ` Lukas Bulwahn -- strict thread matches above, loose matches on Subject: below -- 2017-08-29 13:39 Himanshu Jha 2017-08-29 13:39 ` Himanshu Jha 2017-08-29 13:55 ` Thierry Reding 2017-08-29 14:14 ` Himanshu Jha 2017-08-29 15:09 ` Thierry Reding 2017-08-29 15:09 ` Thierry Reding 2017-08-30 13:59 ` Bjorn Helgaas 2017-08-30 14:25 ` Thierry Reding 2017-08-30 16:26 ` Bjorn Helgaas
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20201116165407.8050-1-sudipm.mukherjee@gmail.com \ --to=sudipm.mukherjee@gmail.com \ --cc=bhelgaas@google.com \ --cc=jonathanh@nvidia.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-pci@vger.kernel.org \ --cc=linux-safety@lists.elisa.tech \ --cc=linux-tegra@vger.kernel.org \ --cc=lorenzo.pieralisi@arm.com \ --cc=robh@kernel.org \ --cc=thierry.reding@gmail.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.