Commit 3f0b59b6 authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: arcmsr: Call scsi_done() directly

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

Link: https://lore.kernel.org/r/20211007202923.2174984-23-bvanassche@acm.orgSigned-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 07ebbc3a
...@@ -1318,7 +1318,7 @@ static void arcmsr_ccb_complete(struct CommandControlBlock *ccb) ...@@ -1318,7 +1318,7 @@ static void arcmsr_ccb_complete(struct CommandControlBlock *ccb)
spin_lock_irqsave(&acb->ccblist_lock, flags); spin_lock_irqsave(&acb->ccblist_lock, flags);
list_add_tail(&ccb->list, &acb->ccb_free_list); list_add_tail(&ccb->list, &acb->ccb_free_list);
spin_unlock_irqrestore(&acb->ccblist_lock, flags); spin_unlock_irqrestore(&acb->ccblist_lock, flags);
pcmd->scsi_done(pcmd); scsi_done(pcmd);
} }
static void arcmsr_report_sense_info(struct CommandControlBlock *ccb) static void arcmsr_report_sense_info(struct CommandControlBlock *ccb)
...@@ -1598,7 +1598,7 @@ static void arcmsr_remove_scsi_devices(struct AdapterControlBlock *acb) ...@@ -1598,7 +1598,7 @@ static void arcmsr_remove_scsi_devices(struct AdapterControlBlock *acb)
if (ccb->startdone == ARCMSR_CCB_START) { if (ccb->startdone == ARCMSR_CCB_START) {
ccb->pcmd->result = DID_NO_CONNECT << 16; ccb->pcmd->result = DID_NO_CONNECT << 16;
arcmsr_pci_unmap_dma(ccb); arcmsr_pci_unmap_dma(ccb);
ccb->pcmd->scsi_done(ccb->pcmd); scsi_done(ccb->pcmd);
} }
} }
for (target = 0; target < ARCMSR_MAX_TARGETID; target++) { for (target = 0; target < ARCMSR_MAX_TARGETID; target++) {
...@@ -3192,7 +3192,7 @@ static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb, ...@@ -3192,7 +3192,7 @@ static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb,
if (cmd->device->lun) { if (cmd->device->lun) {
cmd->result = (DID_TIME_OUT << 16); cmd->result = (DID_TIME_OUT << 16);
cmd->scsi_done(cmd); scsi_done(cmd);
return; return;
} }
inqdata[0] = TYPE_PROCESSOR; inqdata[0] = TYPE_PROCESSOR;
...@@ -3216,18 +3216,18 @@ static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb, ...@@ -3216,18 +3216,18 @@ static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb,
sg = scsi_sglist(cmd); sg = scsi_sglist(cmd);
kunmap_atomic(buffer - sg->offset); kunmap_atomic(buffer - sg->offset);
cmd->scsi_done(cmd); scsi_done(cmd);
} }
break; break;
case WRITE_BUFFER: case WRITE_BUFFER:
case READ_BUFFER: { case READ_BUFFER: {
if (arcmsr_iop_message_xfer(acb, cmd)) if (arcmsr_iop_message_xfer(acb, cmd))
cmd->result = (DID_ERROR << 16); cmd->result = (DID_ERROR << 16);
cmd->scsi_done(cmd); scsi_done(cmd);
} }
break; break;
default: default:
cmd->scsi_done(cmd); scsi_done(cmd);
} }
} }
...@@ -3241,10 +3241,9 @@ static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd, ...@@ -3241,10 +3241,9 @@ static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd,
if (acb->acb_flags & ACB_F_ADAPTER_REMOVED) { if (acb->acb_flags & ACB_F_ADAPTER_REMOVED) {
cmd->result = (DID_NO_CONNECT << 16); cmd->result = (DID_NO_CONNECT << 16);
cmd->scsi_done(cmd); scsi_done(cmd);
return 0; return 0;
} }
cmd->scsi_done = done;
cmd->host_scribble = NULL; cmd->host_scribble = NULL;
cmd->result = 0; cmd->result = 0;
if (target == 16) { if (target == 16) {
...@@ -3257,7 +3256,7 @@ static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd, ...@@ -3257,7 +3256,7 @@ static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd,
return SCSI_MLQUEUE_HOST_BUSY; return SCSI_MLQUEUE_HOST_BUSY;
if (arcmsr_build_ccb( acb, ccb, cmd ) == FAILED) { if (arcmsr_build_ccb( acb, ccb, cmd ) == FAILED) {
cmd->result = (DID_ERROR << 16) | SAM_STAT_RESERVATION_CONFLICT; cmd->result = (DID_ERROR << 16) | SAM_STAT_RESERVATION_CONFLICT;
cmd->scsi_done(cmd); scsi_done(cmd);
return 0; return 0;
} }
arcmsr_post_ccb(acb, ccb); arcmsr_post_ccb(acb, ccb);
......
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