diff --git a/qla2x00t-32gbit/qla_nvme.c b/qla2x00t-32gbit/qla_nvme.c index 7db0f73dc..21af641b0 100644 --- a/qla2x00t-32gbit/qla_nvme.c +++ b/qla2x00t-32gbit/qla_nvme.c @@ -142,11 +142,8 @@ static void qla_nvme_sp_ls_done(void *ptr, int res) struct nvmefc_ls_req *fd; struct nvme_private *priv; - if (atomic_read(&sp->ref_count) == 0) { - ql_log(ql_log_warn, sp->fcport->vha, 0x2123, - "SP reference-count to ZERO on LS_done -- sp=%p.\n", sp); + if (WARN_ON(atomic_read(&sp->ref_count) == 0)) return; - } if (!atomic_dec_and_test(&sp->ref_count)) return; diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index 2a3f71c3f..e6f47318c 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -807,14 +807,9 @@ qla2x00_sp_compl(void *ptr, int res) cmd->result = res; - if (atomic_read(&sp->ref_count) == 0) { - ql_dbg(ql_dbg_io, sp->vha, 0x3015, - "SP reference-count to ZERO -- sp=%p cmd=%p.\n", - sp, GET_CMD_SP(sp)); - if (ql2xextended_error_logging & ql_dbg_io) - WARN_ON(atomic_read(&sp->ref_count) == 0); + if (WARN_ON(atomic_read(&sp->ref_count) == 0)) return; - } + if (!atomic_dec_and_test(&sp->ref_count)) return; @@ -916,14 +911,9 @@ qla2xxx_qpair_sp_compl(void *ptr, int res) cmd->result = res; - if (atomic_read(&sp->ref_count) == 0) { - ql_dbg(ql_dbg_io, sp->fcport->vha, 0x3079, - "SP reference-count to ZERO -- sp=%p cmd=%p.\n", - sp, GET_CMD_SP(sp)); - if (ql2xextended_error_logging & ql_dbg_io) - WARN_ON(atomic_read(&sp->ref_count) == 0); + if (WARN_ON(atomic_read(&sp->ref_count) == 0)) return; - } + if (!atomic_dec_and_test(&sp->ref_count)) return; diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index 5f8bad65f..6465fdb59 100644 --- a/qla2x00t/qla_os.c +++ b/qla2x00t/qla_os.c @@ -679,14 +679,9 @@ qla2x00_sp_compl(void *data, void *ptr, int res) cmd->result = res; - if (atomic_read(&sp->ref_count) == 0) { - ql_dbg(ql_dbg_io, sp->fcport->vha, 0x3015, - "SP reference-count to ZERO -- sp=%p cmd=%p.\n", - sp, GET_CMD_SP(sp)); - if (ql2xextended_error_logging & ql_dbg_io) - BUG(); + if (WARN_ON(atomic_read(&sp->ref_count) == 0)) return; - } + if (!atomic_dec_and_test(&sp->ref_count)) return;