mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
scsi: megaraid_sas: Call scsi_done() directly
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/20211007202923.2174984-49-bvanassche@acm.org Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
f1170b83df
commit
012f14b269
2 changed files with 11 additions and 11 deletions
|
@ -1794,7 +1794,7 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
|
|||
|
||||
if (instance->unload == 1) {
|
||||
scmd->result = DID_NO_CONNECT << 16;
|
||||
scmd->scsi_done(scmd);
|
||||
scsi_done(scmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1809,7 +1809,7 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
|
|||
return SCSI_MLQUEUE_HOST_BUSY;
|
||||
} else {
|
||||
scmd->result = DID_NO_CONNECT << 16;
|
||||
scmd->scsi_done(scmd);
|
||||
scsi_done(scmd);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1818,7 +1818,7 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
|
|||
if (!mr_device_priv_data ||
|
||||
(atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR)) {
|
||||
scmd->result = DID_NO_CONNECT << 16;
|
||||
scmd->scsi_done(scmd);
|
||||
scsi_done(scmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1826,7 +1826,7 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
|
|||
ld_tgt_id = MEGASAS_TARGET_ID(scmd->device);
|
||||
if (instance->ld_tgtid_status[ld_tgt_id] == LD_TARGET_ID_DELETED) {
|
||||
scmd->result = DID_NO_CONNECT << 16;
|
||||
scmd->scsi_done(scmd);
|
||||
scsi_done(scmd);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1857,7 +1857,7 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
|
|||
return instance->instancet->build_and_issue_cmd(instance, scmd);
|
||||
|
||||
out_done:
|
||||
scmd->scsi_done(scmd);
|
||||
scsi_done(scmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2783,7 +2783,7 @@ static int megasas_wait_for_outstanding(struct megasas_instance *instance)
|
|||
reset_index, reset_cmd,
|
||||
reset_cmd->scmd->cmnd[0]);
|
||||
|
||||
reset_cmd->scmd->scsi_done(reset_cmd->scmd);
|
||||
scsi_done(reset_cmd->scmd);
|
||||
megasas_return_cmd(instance, reset_cmd);
|
||||
} else if (reset_cmd->sync_cmd) {
|
||||
dev_notice(&instance->pdev->dev, "%p synch cmds"
|
||||
|
@ -3640,7 +3640,7 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
|
|||
atomic_dec(&instance->fw_outstanding);
|
||||
|
||||
scsi_dma_unmap(cmd->scmd);
|
||||
cmd->scmd->scsi_done(cmd->scmd);
|
||||
scsi_done(cmd->scmd);
|
||||
megasas_return_cmd(instance, cmd);
|
||||
|
||||
break;
|
||||
|
@ -3686,7 +3686,7 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
|
|||
atomic_dec(&instance->fw_outstanding);
|
||||
|
||||
scsi_dma_unmap(cmd->scmd);
|
||||
cmd->scmd->scsi_done(cmd->scmd);
|
||||
scsi_done(cmd->scmd);
|
||||
megasas_return_cmd(instance, cmd);
|
||||
|
||||
break;
|
||||
|
|
|
@ -3493,7 +3493,7 @@ megasas_complete_r1_command(struct megasas_instance *instance,
|
|||
megasas_return_cmd_fusion(instance, cmd);
|
||||
scsi_dma_unmap(scmd_local);
|
||||
megasas_sdev_busy_dec(instance, scmd_local);
|
||||
scmd_local->scsi_done(scmd_local);
|
||||
scsi_done(scmd_local);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3634,7 +3634,7 @@ complete_cmd_fusion(struct megasas_instance *instance, u32 MSIxIndex,
|
|||
megasas_return_cmd_fusion(instance, cmd_fusion);
|
||||
scsi_dma_unmap(scmd_local);
|
||||
megasas_sdev_busy_dec(instance, scmd_local);
|
||||
scmd_local->scsi_done(scmd_local);
|
||||
scsi_done(scmd_local);
|
||||
} else /* Optimal VD - R1 FP command completion. */
|
||||
megasas_complete_r1_command(instance, cmd_fusion);
|
||||
break;
|
||||
|
@ -5013,7 +5013,7 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason)
|
|||
atomic_dec(&instance->ldio_outstanding);
|
||||
megasas_return_cmd_fusion(instance, cmd_fusion);
|
||||
scsi_dma_unmap(scmd_local);
|
||||
scmd_local->scsi_done(scmd_local);
|
||||
scsi_done(scmd_local);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue