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

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

index d383d4a..3946253 100644 (file)
@@ -3314,7 +3314,7 @@ scsih_abort(struct scsi_cmnd *scmd)
                sdev_printk(KERN_INFO, scmd->device,
                    "device been deleted! scmd(0x%p)\n", scmd);
                scmd->result = DID_NO_CONNECT << 16;
-               scmd->scsi_done(scmd);
+               scsi_done(scmd);
                r = SUCCESS;
                goto out;
        }
@@ -3390,7 +3390,7 @@ scsih_dev_reset(struct scsi_cmnd *scmd)
                sdev_printk(KERN_INFO, scmd->device,
                    "device been deleted! scmd(0x%p)\n", scmd);
                scmd->result = DID_NO_CONNECT << 16;
-               scmd->scsi_done(scmd);
+               scsi_done(scmd);
                r = SUCCESS;
                goto out;
        }
@@ -3470,7 +3470,7 @@ scsih_target_reset(struct scsi_cmnd *scmd)
                starget_printk(KERN_INFO, starget,
                    "target been deleted! scmd(0x%p)\n", scmd);
                scmd->result = DID_NO_CONNECT << 16;
-               scmd->scsi_done(scmd);
+               scsi_done(scmd);
                r = SUCCESS;
                goto out;
        }
@@ -5030,7 +5030,7 @@ _scsih_flush_running_cmds(struct MPT3SAS_ADAPTER *ioc)
                        scmd->result = DID_NO_CONNECT << 16;
                else
                        scmd->result = DID_RESET << 16;
-               scmd->scsi_done(scmd);
+               scsi_done(scmd);
        }
        dtmprintk(ioc, ioc_info(ioc, "completing %d cmds\n", count));
 }
@@ -5139,13 +5139,13 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
        sas_device_priv_data = scmd->device->hostdata;
        if (!sas_device_priv_data || !sas_device_priv_data->sas_target) {
                scmd->result = DID_NO_CONNECT << 16;
-               scmd->scsi_done(scmd);
+               scsi_done(scmd);
                return 0;
        }
 
        if (!(_scsih_allow_scmd_to_device(ioc, scmd))) {
                scmd->result = DID_NO_CONNECT << 16;
-               scmd->scsi_done(scmd);
+               scsi_done(scmd);
                return 0;
        }
 
@@ -5155,7 +5155,7 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
        handle = sas_target_priv_data->handle;
        if (handle == MPT3SAS_INVALID_DEVICE_HANDLE) {
                scmd->result = DID_NO_CONNECT << 16;
-               scmd->scsi_done(scmd);
+               scsi_done(scmd);
                return 0;
        }
 
@@ -5166,7 +5166,7 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
        } else if (sas_target_priv_data->deleted) {
                /* device has been deleted */
                scmd->result = DID_NO_CONNECT << 16;
-               scmd->scsi_done(scmd);
+               scsi_done(scmd);
                return 0;
        } else if (sas_target_priv_data->tm_busy ||
                   sas_device_priv_data->block) {
@@ -5909,7 +5909,7 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply)
 
        scsi_dma_unmap(scmd);
        mpt3sas_base_free_smid(ioc, smid);
-       scmd->scsi_done(scmd);
+       scsi_done(scmd);
        return 0;
 }