Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> --- drivers/scsi/hosts.c | 2 +- include/scsi/scsi_host.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 3f6f14f0cafb..de5f5949a7a9 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -666,7 +666,7 @@ static bool complete_all_cmds_iter(struct request *rq, void *data, bool rsvd) scsi_dma_unmap(scmd); scmd->result = 0; set_host_byte(scmd, status); - scmd->scsi_done(scmd); + scsi_done(scmd); return true; } diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 75363707b73f..3329dde02a2c 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -516,7 +516,7 @@ struct scsi_host_template { unsigned long irq_flags; \ int rc; \ spin_lock_irqsave(shost->host_lock, irq_flags); \ - rc = func_name##_lck (cmd, cmd->scsi_done); \ + rc = func_name##_lck (cmd, scsi_done); \ spin_unlock_irqrestore(shost->host_lock, irq_flags); \ return rc; \ }