Skip to content

Commit 806eed7

Browse files
committed
scsi: qedf: Call scsi_done() directly
JIRA: https://issues.redhat.com/browse/RHEL-72637 Conflicts: resolve conflict because of commit a33e792 ("scsi: qedf: Stop using the SCSI pointer") taken out of order. 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> (cherry picked from commit ef69768) Signed-off-by: John Meneghini <jmeneghi@redhat.com>
1 parent 9b872fa commit 806eed7

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

drivers/scsi/qedf/qedf_io.c

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd)
950950
"Number of SG elements %d exceeds what hardware limitation of %d.\n",
951951
num_sgs, QEDF_MAX_BDS_PER_CMD);
952952
sc_cmd->result = DID_ERROR;
953-
sc_cmd->scsi_done(sc_cmd);
953+
scsi_done(sc_cmd);
954954
return 0;
955955
}
956956

@@ -960,7 +960,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd)
960960
"Returning DNC as unloading or stop io, flags 0x%lx.\n",
961961
qedf->flags);
962962
sc_cmd->result = DID_NO_CONNECT << 16;
963-
sc_cmd->scsi_done(sc_cmd);
963+
scsi_done(sc_cmd);
964964
return 0;
965965
}
966966

@@ -969,7 +969,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd)
969969
"Completing sc_cmd=%p DID_NO_CONNECT as MSI-X is not enabled.\n",
970970
sc_cmd);
971971
sc_cmd->result = DID_NO_CONNECT << 16;
972-
sc_cmd->scsi_done(sc_cmd);
972+
scsi_done(sc_cmd);
973973
return 0;
974974
}
975975

@@ -979,7 +979,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd)
979979
"fc_remote_port_chkready failed=0x%x for port_id=0x%06x.\n",
980980
rval, rport->port_id);
981981
sc_cmd->result = rval;
982-
sc_cmd->scsi_done(sc_cmd);
982+
scsi_done(sc_cmd);
983983
return 0;
984984
}
985985

@@ -1315,7 +1315,7 @@ void qedf_scsi_completion(struct qedf_ctx *qedf, struct fcoe_cqe *cqe,
13151315

13161316
io_req->sc_cmd = NULL;
13171317
qedf_priv(sc_cmd)->io_req = NULL;
1318-
sc_cmd->scsi_done(sc_cmd);
1318+
scsi_done(sc_cmd);
13191319
kref_put(&io_req->refcount, qedf_release_cmd);
13201320
}
13211321

@@ -1388,13 +1388,6 @@ void qedf_scsi_done(struct qedf_ctx *qedf, struct qedf_ioreq *io_req,
13881388
goto bad_scsi_ptr;
13891389
}
13901390

1391-
if (!sc_cmd->scsi_done) {
1392-
QEDF_ERR(&qedf->dbg_ctx,
1393-
"sc_cmd->scsi_done for sc_cmd %p is NULL.\n",
1394-
sc_cmd);
1395-
goto bad_scsi_ptr;
1396-
}
1397-
13981391
qedf_unmap_sg_list(qedf, io_req);
13991392

14001393
sc_cmd->result = result << 16;
@@ -1419,7 +1412,7 @@ void qedf_scsi_done(struct qedf_ctx *qedf, struct qedf_ioreq *io_req,
14191412

14201413
io_req->sc_cmd = NULL;
14211414
qedf_priv(sc_cmd)->io_req = NULL;
1422-
sc_cmd->scsi_done(sc_cmd);
1415+
scsi_done(sc_cmd);
14231416
kref_put(&io_req->refcount, qedf_release_cmd);
14241417
return;
14251418

0 commit comments

Comments
 (0)