scsi: bnx2fc: Call scsi_done() directly
authorBart Van Assche <bvanassche@acm.org>
Thu, 7 Oct 2021 20:28:20 +0000 (13:28 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 17 Oct 2021 01:28:46 +0000 (21:28 -0400)
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.

Link: https://lore.kernel.org/r/20211007202923.2174984-26-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/bnx2fc/bnx2fc_io.c

index f2996a9b2f639cb1e7e9061f63d3286710227b62..b9114113ee73b8c2290a3b1c8471ddf9bacf8c01 100644 (file)
@@ -205,7 +205,7 @@ static void bnx2fc_scsi_done(struct bnx2fc_cmd *io_req, int err_code)
                sc_cmd->allowed);
        scsi_set_resid(sc_cmd, scsi_bufflen(sc_cmd));
        sc_cmd->SCp.ptr = NULL;
-       sc_cmd->scsi_done(sc_cmd);
+       scsi_done(sc_cmd);
 }
 
 struct bnx2fc_cmd_mgr *bnx2fc_cmd_mgr_alloc(struct bnx2fc_hba *hba)
@@ -1610,7 +1610,7 @@ void bnx2fc_process_tm_compl(struct bnx2fc_cmd *io_req,
        }
 
        sc_cmd->SCp.ptr = NULL;
-       sc_cmd->scsi_done(sc_cmd);
+       scsi_done(sc_cmd);
 
        kref_put(&io_req->refcount, bnx2fc_cmd_release);
        if (io_req->wait_for_abts_comp) {
@@ -1853,7 +1853,7 @@ int bnx2fc_queuecommand(struct Scsi_Host *host,
        rval = fc_remote_port_chkready(rport);
        if (rval) {
                sc_cmd->result = rval;
-               sc_cmd->scsi_done(sc_cmd);
+               scsi_done(sc_cmd);
                return 0;
        }
 
@@ -2019,7 +2019,7 @@ void bnx2fc_process_scsi_cmd_compl(struct bnx2fc_cmd *io_req,
                break;
        }
        sc_cmd->SCp.ptr = NULL;
-       sc_cmd->scsi_done(sc_cmd);
+       scsi_done(sc_cmd);
        kref_put(&io_req->refcount, bnx2fc_cmd_release);
 }