Commit ef697683 authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: qedf: Call scsi_done() directly

Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.

Link: https://lore.kernel.org/r/20211007202923.2174984-64-bvanassche@acm.orgSigned-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 3ca2385a
...@@ -947,7 +947,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd) ...@@ -947,7 +947,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd)
"Number of SG elements %d exceeds what hardware limitation of %d.\n", "Number of SG elements %d exceeds what hardware limitation of %d.\n",
num_sgs, QEDF_MAX_BDS_PER_CMD); num_sgs, QEDF_MAX_BDS_PER_CMD);
sc_cmd->result = DID_ERROR; sc_cmd->result = DID_ERROR;
sc_cmd->scsi_done(sc_cmd); scsi_done(sc_cmd);
return 0; return 0;
} }
...@@ -957,7 +957,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd) ...@@ -957,7 +957,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd)
"Returning DNC as unloading or stop io, flags 0x%lx.\n", "Returning DNC as unloading or stop io, flags 0x%lx.\n",
qedf->flags); qedf->flags);
sc_cmd->result = DID_NO_CONNECT << 16; sc_cmd->result = DID_NO_CONNECT << 16;
sc_cmd->scsi_done(sc_cmd); scsi_done(sc_cmd);
return 0; return 0;
} }
...@@ -966,7 +966,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd) ...@@ -966,7 +966,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd)
"Completing sc_cmd=%p DID_NO_CONNECT as MSI-X is not enabled.\n", "Completing sc_cmd=%p DID_NO_CONNECT as MSI-X is not enabled.\n",
sc_cmd); sc_cmd);
sc_cmd->result = DID_NO_CONNECT << 16; sc_cmd->result = DID_NO_CONNECT << 16;
sc_cmd->scsi_done(sc_cmd); scsi_done(sc_cmd);
return 0; return 0;
} }
...@@ -976,7 +976,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd) ...@@ -976,7 +976,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd)
"fc_remote_port_chkready failed=0x%x for port_id=0x%06x.\n", "fc_remote_port_chkready failed=0x%x for port_id=0x%06x.\n",
rval, rport->port_id); rval, rport->port_id);
sc_cmd->result = rval; sc_cmd->result = rval;
sc_cmd->scsi_done(sc_cmd); scsi_done(sc_cmd);
return 0; return 0;
} }
...@@ -1313,7 +1313,7 @@ void qedf_scsi_completion(struct qedf_ctx *qedf, struct fcoe_cqe *cqe, ...@@ -1313,7 +1313,7 @@ void qedf_scsi_completion(struct qedf_ctx *qedf, struct fcoe_cqe *cqe,
io_req->sc_cmd = NULL; io_req->sc_cmd = NULL;
sc_cmd->SCp.ptr = NULL; sc_cmd->SCp.ptr = NULL;
sc_cmd->scsi_done(sc_cmd); scsi_done(sc_cmd);
kref_put(&io_req->refcount, qedf_release_cmd); kref_put(&io_req->refcount, qedf_release_cmd);
} }
...@@ -1386,13 +1386,6 @@ void qedf_scsi_done(struct qedf_ctx *qedf, struct qedf_ioreq *io_req, ...@@ -1386,13 +1386,6 @@ void qedf_scsi_done(struct qedf_ctx *qedf, struct qedf_ioreq *io_req,
goto bad_scsi_ptr; goto bad_scsi_ptr;
} }
if (!sc_cmd->scsi_done) {
QEDF_ERR(&qedf->dbg_ctx,
"sc_cmd->scsi_done for sc_cmd %p is NULL.\n",
sc_cmd);
goto bad_scsi_ptr;
}
qedf_unmap_sg_list(qedf, io_req); qedf_unmap_sg_list(qedf, io_req);
sc_cmd->result = result << 16; sc_cmd->result = result << 16;
...@@ -1417,7 +1410,7 @@ void qedf_scsi_done(struct qedf_ctx *qedf, struct qedf_ioreq *io_req, ...@@ -1417,7 +1410,7 @@ void qedf_scsi_done(struct qedf_ctx *qedf, struct qedf_ioreq *io_req,
io_req->sc_cmd = NULL; io_req->sc_cmd = NULL;
sc_cmd->SCp.ptr = NULL; sc_cmd->SCp.ptr = NULL;
sc_cmd->scsi_done(sc_cmd); scsi_done(sc_cmd);
kref_put(&io_req->refcount, qedf_release_cmd); kref_put(&io_req->refcount, qedf_release_cmd);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment