[PATCH] scsi: qla2xxx: Use PTR_ERR_OR_ZERO to replace the open coded version

From: Wen Yang
Date: Tue Nov 27 2018 - 03:21:15 EST


PTR_ERR_OR_ZERO has implemented the same function, so use inlined function
instead of open coded equivalent.

Signed-off-by: Wen Yang <wen.yang99@xxxxxxxxxx>
CC: "James E.J. Bottomley" <jejb@xxxxxxxxxxxxxxxxxx>
CC: "Martin K. Petersen" <martin.petersen@xxxxxxxxxx>
CC: qla2xxx-upstream@xxxxxxxxxx
CC: linux-scsi@xxxxxxxxxxxxxxx
CC: Wen Yang <yellowriver2010@xxxxxxxxxxx>
CC: linux-kernel@xxxxxxxxxxxxxxx
---
drivers/scsi/qla2xxx/tcm_qla2xxx.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
index 65053c066680..633f258085c7 100644
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
@@ -1577,10 +1577,7 @@ static int tcm_qla2xxx_check_initiator_node_acl(
sizeof(struct qla_tgt_cmd),
TARGET_PROT_ALL, port_name,
qlat_sess, tcm_qla2xxx_session_cb);
- if (IS_ERR(se_sess))
- return PTR_ERR(se_sess);
-
- return 0;
+ return PTR_ERR_OR_ZERO(se_sess);
}

static void tcm_qla2xxx_update_sess(struct fc_port *sess, port_id_t s_id,
--
2.19.1