diff mbox series

[45/84] libsas: Call scsi_done() directly

Message ID 20210918000607.450448-46-bvanassche@acm.org (mailing list archive)
State Superseded
Headers show
Series Call scsi_done() directly | expand

Commit Message

Bart Van Assche Sept. 18, 2021, 12:05 a.m. UTC
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/libsas/sas_scsi_host.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

John Garry Sept. 22, 2021, 5:26 p.m. UTC | #1
On 18/09/2021 01:05, Bart Van Assche wrote:
> Conditional statements are faster than indirect calls.

Some might say safer as well

> Hence call
> scsi_done() directly.
> 
> Signed-off-by: Bart Van Assche<bvanassche@acm.org>

Reviewed-by: John Garry <john.garry@huawei.com>
diff mbox series

Patch

diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
index 2bf37151623e..d337fdf1b9ca 100644
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -125,7 +125,7 @@  static void sas_scsi_task_done(struct sas_task *task)
 	}
 
 	sas_end_task(sc, task);
-	sc->scsi_done(sc);
+	scsi_done(sc);
 }
 
 static struct sas_task *sas_create_task(struct scsi_cmnd *cmd,
@@ -198,7 +198,7 @@  int sas_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
 	else
 		cmd->result = DID_ERROR << 16;
 out_done:
-	cmd->scsi_done(cmd);
+	scsi_done(cmd);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(sas_queuecommand);