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

scsi: message: fusion: Call scsi_done() directly

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

Link: https://lore.kernel.org/r/20211007202923.2174984-7-bvanassche@acm.orgSigned-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 5f9ae9ee
...@@ -649,14 +649,14 @@ mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt) ...@@ -649,14 +649,14 @@ mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt)
if (!vdevice || !vdevice->vtarget) { if (!vdevice || !vdevice->vtarget) {
SCpnt->result = DID_NO_CONNECT << 16; SCpnt->result = DID_NO_CONNECT << 16;
SCpnt->scsi_done(SCpnt); scsi_done(SCpnt);
return 0; return 0;
} }
err = fc_remote_port_chkready(rport); err = fc_remote_port_chkready(rport);
if (unlikely(err)) { if (unlikely(err)) {
SCpnt->result = err; SCpnt->result = err;
SCpnt->scsi_done(SCpnt); scsi_done(SCpnt);
return 0; return 0;
} }
...@@ -664,7 +664,7 @@ mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt) ...@@ -664,7 +664,7 @@ mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt)
ri = *((struct mptfc_rport_info **)rport->dd_data); ri = *((struct mptfc_rport_info **)rport->dd_data);
if (unlikely(!ri)) { if (unlikely(!ri)) {
SCpnt->result = DID_IMM_RETRY << 16; SCpnt->result = DID_IMM_RETRY << 16;
SCpnt->scsi_done(SCpnt); scsi_done(SCpnt);
return 0; return 0;
} }
......
...@@ -1929,7 +1929,7 @@ mptsas_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt) ...@@ -1929,7 +1929,7 @@ mptsas_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt)
if (!vdevice || !vdevice->vtarget || vdevice->vtarget->deleted) { if (!vdevice || !vdevice->vtarget || vdevice->vtarget->deleted) {
SCpnt->result = DID_NO_CONNECT << 16; SCpnt->result = DID_NO_CONNECT << 16;
SCpnt->scsi_done(SCpnt); scsi_done(SCpnt);
return 0; return 0;
} }
......
...@@ -1009,7 +1009,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) ...@@ -1009,7 +1009,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
/* Unmap the DMA buffers, if any. */ /* Unmap the DMA buffers, if any. */
scsi_dma_unmap(sc); scsi_dma_unmap(sc);
sc->scsi_done(sc); /* Issue the command callback */ scsi_done(sc); /* Issue the command callback */
/* Free Chain buffers */ /* Free Chain buffers */
mptscsih_freeChainBuffers(ioc, req_idx); mptscsih_freeChainBuffers(ioc, req_idx);
...@@ -1054,7 +1054,7 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd) ...@@ -1054,7 +1054,7 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
dtmprintk(ioc, sdev_printk(KERN_INFO, sc->device, MYIOC_s_FMT dtmprintk(ioc, sdev_printk(KERN_INFO, sc->device, MYIOC_s_FMT
"completing cmds: fw_channel %d, fw_id %d, sc=%p, mf = %p, " "completing cmds: fw_channel %d, fw_id %d, sc=%p, mf = %p, "
"idx=%x\n", ioc->name, channel, id, sc, mf, ii)); "idx=%x\n", ioc->name, channel, id, sc, mf, ii));
sc->scsi_done(sc); scsi_done(sc);
} }
} }
EXPORT_SYMBOL(mptscsih_flush_running_cmds); EXPORT_SYMBOL(mptscsih_flush_running_cmds);
...@@ -1118,7 +1118,7 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice) ...@@ -1118,7 +1118,7 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
"fw_id %d, sc=%p, mf = %p, idx=%x\n", ioc->name, "fw_id %d, sc=%p, mf = %p, idx=%x\n", ioc->name,
vdevice->vtarget->channel, vdevice->vtarget->id, vdevice->vtarget->channel, vdevice->vtarget->id,
sc, mf, ii)); sc, mf, ii));
sc->scsi_done(sc); scsi_done(sc);
spin_lock_irqsave(&ioc->scsi_lookup_lock, flags); spin_lock_irqsave(&ioc->scsi_lookup_lock, flags);
} }
} }
...@@ -1693,7 +1693,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) ...@@ -1693,7 +1693,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
*/ */
if ((hd = shost_priv(SCpnt->device->host)) == NULL) { if ((hd = shost_priv(SCpnt->device->host)) == NULL) {
SCpnt->result = DID_RESET << 16; SCpnt->result = DID_RESET << 16;
SCpnt->scsi_done(SCpnt); scsi_done(SCpnt);
printk(KERN_ERR MYNAM ": task abort: " printk(KERN_ERR MYNAM ": task abort: "
"can't locate host! (sc=%p)\n", SCpnt); "can't locate host! (sc=%p)\n", SCpnt);
return FAILED; return FAILED;
...@@ -1710,7 +1710,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) ...@@ -1710,7 +1710,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
"task abort: device has been deleted (sc=%p)\n", "task abort: device has been deleted (sc=%p)\n",
ioc->name, SCpnt)); ioc->name, SCpnt));
SCpnt->result = DID_NO_CONNECT << 16; SCpnt->result = DID_NO_CONNECT << 16;
SCpnt->scsi_done(SCpnt); scsi_done(SCpnt);
retval = SUCCESS; retval = SUCCESS;
goto out; goto out;
} }
......
...@@ -782,14 +782,14 @@ mptspi_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt) ...@@ -782,14 +782,14 @@ mptspi_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt)
if (!vdevice || !vdevice->vtarget) { if (!vdevice || !vdevice->vtarget) {
SCpnt->result = DID_NO_CONNECT << 16; SCpnt->result = DID_NO_CONNECT << 16;
SCpnt->scsi_done(SCpnt); scsi_done(SCpnt);
return 0; return 0;
} }
if (SCpnt->device->channel == 1 && if (SCpnt->device->channel == 1 &&
mptscsih_is_phys_disk(ioc, 0, SCpnt->device->id) == 0) { mptscsih_is_phys_disk(ioc, 0, SCpnt->device->id) == 0) {
SCpnt->result = DID_NO_CONNECT << 16; SCpnt->result = DID_NO_CONNECT << 16;
SCpnt->scsi_done(SCpnt); scsi_done(SCpnt);
return 0; return 0;
} }
......
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