From 3ca2385af90534278afc95f79bd465211a5e3103 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 7 Oct 2021 13:28:57 -0700 Subject: scsi: ps3rom: Call scsi_done() directly Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/20211007202923.2174984-63-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen --- drivers/scsi/ps3rom.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/scsi/ps3rom.c') diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c index 0f4b99d92f12..08e970300b3f 100644 --- a/drivers/scsi/ps3rom.c +++ b/drivers/scsi/ps3rom.c @@ -209,7 +209,6 @@ static int ps3rom_queuecommand_lck(struct scsi_cmnd *cmd, int res; priv->curr_cmd = cmd; - cmd->scsi_done = done; opcode = cmd->cmnd[0]; /* @@ -237,7 +236,7 @@ static int ps3rom_queuecommand_lck(struct scsi_cmnd *cmd, scsi_build_sense(cmd, 0, ILLEGAL_REQUEST, 0, 0); cmd->result = res; priv->curr_cmd = NULL; - cmd->scsi_done(cmd); + scsi_done(cmd); } return 0; @@ -321,7 +320,7 @@ static irqreturn_t ps3rom_interrupt(int irq, void *data) done: priv->curr_cmd = NULL; - cmd->scsi_done(cmd); + scsi_done(cmd); return IRQ_HANDLED; } -- cgit v1.2.3 From af049dfd0b105bab32170d1c68826a4cd8424efd Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 7 Oct 2021 13:46:14 -0700 Subject: scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions The DEF_SCSI_QCMD() macro passes the addresses of the SCSI host lock and also that of the scsi_done function to the queuecommand_lck() function implementations. Remove the 'scsi_done' argument since its address is now a constant and instead call 'scsi_done' directly from inside the queuecommand_lck() functions. Link: https://lore.kernel.org/r/20211007204618.2196847-14-bvanassche@acm.org Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen --- drivers/scsi/ps3rom.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/scsi/ps3rom.c') diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c index 08e970300b3f..2b80cab70333 100644 --- a/drivers/scsi/ps3rom.c +++ b/drivers/scsi/ps3rom.c @@ -200,8 +200,7 @@ static int ps3rom_write_request(struct ps3_storage_device *dev, return 0; } -static int ps3rom_queuecommand_lck(struct scsi_cmnd *cmd, - void (*done)(struct scsi_cmnd *)) +static int ps3rom_queuecommand_lck(struct scsi_cmnd *cmd) { struct ps3rom_private *priv = shost_priv(cmd->device->host); struct ps3_storage_device *dev = priv->dev; -- cgit v1.2.3