diff options
author | Bart Van Assche <bvanassche@acm.org> | 2021-10-07 23:28:58 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-10-17 04:31:40 +0300 |
commit | ef697683d3eb6455c911212513256b1633fcec62 (patch) | |
tree | fa4428134b2be4d9db121963fa6408ef17d74f7f /drivers/scsi/qedf/qedf_io.c | |
parent | 3ca2385af90534278afc95f79bd465211a5e3103 (diff) | |
download | linux-ef697683d3eb6455c911212513256b1633fcec62.tar.xz |
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.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qedf/qedf_io.c')
-rw-r--r-- | drivers/scsi/qedf/qedf_io.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c index 3404782988d5..14aa544b0bc3 100644 --- a/drivers/scsi/qedf/qedf_io.c +++ b/drivers/scsi/qedf/qedf_io.c @@ -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", num_sgs, QEDF_MAX_BDS_PER_CMD); sc_cmd->result = DID_ERROR; - sc_cmd->scsi_done(sc_cmd); + scsi_done(sc_cmd); return 0; } @@ -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", qedf->flags); sc_cmd->result = DID_NO_CONNECT << 16; - sc_cmd->scsi_done(sc_cmd); + scsi_done(sc_cmd); return 0; } @@ -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", sc_cmd); sc_cmd->result = DID_NO_CONNECT << 16; - sc_cmd->scsi_done(sc_cmd); + scsi_done(sc_cmd); return 0; } @@ -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", rval, rport->port_id); sc_cmd->result = rval; - sc_cmd->scsi_done(sc_cmd); + scsi_done(sc_cmd); return 0; } @@ -1313,7 +1313,7 @@ out: io_req->sc_cmd = NULL; sc_cmd->SCp.ptr = NULL; - sc_cmd->scsi_done(sc_cmd); + scsi_done(sc_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, 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); sc_cmd->result = result << 16; @@ -1417,7 +1410,7 @@ void qedf_scsi_done(struct qedf_ctx *qedf, struct qedf_ioreq *io_req, io_req->sc_cmd = NULL; sc_cmd->SCp.ptr = NULL; - sc_cmd->scsi_done(sc_cmd); + scsi_done(sc_cmd); kref_put(&io_req->refcount, qedf_release_cmd); return; |