Skip to content

Commit 63a0b7d

Browse files
Ruan Jinjiebjorn-helgaas
authored andcommitted
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 <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]>
1 parent 0bb80ec commit 63a0b7d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/pci/endpoint/pci-epc-core.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static int devm_pci_epc_match(struct device *dev, void *res, void *match_data)
3838
*/
3939
void pci_epc_put(struct pci_epc *epc)
4040
{
41-
if (!epc || IS_ERR(epc))
41+
if (IS_ERR_OR_NULL(epc))
4242
return;
4343

4444
module_put(epc->ops->owner);
@@ -660,7 +660,7 @@ void pci_epc_remove_epf(struct pci_epc *epc, struct pci_epf *epf,
660660
struct list_head *list;
661661
u32 func_no = 0;
662662

663-
if (!epc || IS_ERR(epc) || !epf)
663+
if (IS_ERR_OR_NULL(epc) || !epf)
664664
return;
665665

666666
if (type == PRIMARY_INTERFACE) {
@@ -691,7 +691,7 @@ void pci_epc_linkup(struct pci_epc *epc)
691691
{
692692
struct pci_epf *epf;
693693

694-
if (!epc || IS_ERR(epc))
694+
if (IS_ERR_OR_NULL(epc))
695695
return;
696696

697697
mutex_lock(&epc->list_lock);
@@ -717,7 +717,7 @@ void pci_epc_linkdown(struct pci_epc *epc)
717717
{
718718
struct pci_epf *epf;
719719

720-
if (!epc || IS_ERR(epc))
720+
if (IS_ERR_OR_NULL(epc))
721721
return;
722722

723723
mutex_lock(&epc->list_lock);
@@ -743,7 +743,7 @@ void pci_epc_init_notify(struct pci_epc *epc)
743743
{
744744
struct pci_epf *epf;
745745

746-
if (!epc || IS_ERR(epc))
746+
if (IS_ERR_OR_NULL(epc))
747747
return;
748748

749749
mutex_lock(&epc->list_lock);
@@ -769,7 +769,7 @@ void pci_epc_bme_notify(struct pci_epc *epc)
769769
{
770770
struct pci_epf *epf;
771771

772-
if (!epc || IS_ERR(epc))
772+
if (IS_ERR_OR_NULL(epc))
773773
return;
774774

775775
mutex_lock(&epc->list_lock);

0 commit comments

Comments
 (0)