summaryrefslogtreecommitdiff
path: root/drivers/pci/endpoint
diff options
context:
space:
mode:
authorRuan Jinjie <ruanjinjie@huawei.com>2023-08-17 10:09:31 +0300
committerBjorn Helgaas <bhelgaas@google.com>2023-10-06 01:14:56 +0300
commit63a0b7dc15376c495dbbeadf55bf887412a7f877 (patch)
treefffd7c8278a208c2d6a6312a39667fe3a31df970 /drivers/pci/endpoint
parent0bb80ecc33a8fb5a682236443c1e740d5c917d1d (diff)
downloadlinux-63a0b7dc15376c495dbbeadf55bf887412a7f877.tar.xz
PCI: endpoint: Use IS_ERR_OR_NULL() helper function
Use the IS_ERR_OR_NULL() helper instead of open-coding a NULL and an error pointer checks to simplify the code and improve readability. No functional changes are intended. [kwilczynski: commit log] Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Signed-off-by: Krzysztof WilczyƄski <kwilczynski@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Diffstat (limited to 'drivers/pci/endpoint')
-rw-r--r--drivers/pci/endpoint/pci-epc-core.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c
index 5a4a8b0be626..fe421d46a8a4 100644
--- a/drivers/pci/endpoint/pci-epc-core.c
+++ b/drivers/pci/endpoint/pci-epc-core.c
@@ -38,7 +38,7 @@ static int devm_pci_epc_match(struct device *dev, void *res, void *match_data)
*/
void pci_epc_put(struct pci_epc *epc)
{
- if (!epc || IS_ERR(epc))
+ if (IS_ERR_OR_NULL(epc))
return;
module_put(epc->ops->owner);
@@ -660,7 +660,7 @@ void pci_epc_remove_epf(struct pci_epc *epc, struct pci_epf *epf,
struct list_head *list;
u32 func_no = 0;
- if (!epc || IS_ERR(epc) || !epf)
+ if (IS_ERR_OR_NULL(epc) || !epf)
return;
if (type == PRIMARY_INTERFACE) {
@@ -691,7 +691,7 @@ void pci_epc_linkup(struct pci_epc *epc)
{
struct pci_epf *epf;
- if (!epc || IS_ERR(epc))
+ if (IS_ERR_OR_NULL(epc))
return;
mutex_lock(&epc->list_lock);
@@ -717,7 +717,7 @@ void pci_epc_linkdown(struct pci_epc *epc)
{
struct pci_epf *epf;
- if (!epc || IS_ERR(epc))
+ if (IS_ERR_OR_NULL(epc))
return;
mutex_lock(&epc->list_lock);
@@ -743,7 +743,7 @@ void pci_epc_init_notify(struct pci_epc *epc)
{
struct pci_epf *epf;
- if (!epc || IS_ERR(epc))
+ if (IS_ERR_OR_NULL(epc))
return;
mutex_lock(&epc->list_lock);
@@ -769,7 +769,7 @@ void pci_epc_bme_notify(struct pci_epc *epc)
{
struct pci_epf *epf;
- if (!epc || IS_ERR(epc))
+ if (IS_ERR_OR_NULL(epc))
return;
mutex_lock(&epc->list_lock);