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

scsi: aha1542: Call scsi_done() directly

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

Link: https://lore.kernel.org/r/20211007202923.2174984-21-bvanassche@acm.orgSigned-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 3ab3b151
...@@ -281,7 +281,6 @@ static irqreturn_t aha1542_interrupt(int irq, void *dev_id) ...@@ -281,7 +281,6 @@ static irqreturn_t aha1542_interrupt(int irq, void *dev_id)
{ {
struct Scsi_Host *sh = dev_id; struct Scsi_Host *sh = dev_id;
struct aha1542_hostdata *aha1542 = shost_priv(sh); struct aha1542_hostdata *aha1542 = shost_priv(sh);
void (*my_done)(struct scsi_cmnd *) = NULL;
int errstatus, mbi, mbo, mbistatus; int errstatus, mbi, mbo, mbistatus;
int number_serviced; int number_serviced;
unsigned long flags; unsigned long flags;
...@@ -369,14 +368,13 @@ static irqreturn_t aha1542_interrupt(int irq, void *dev_id) ...@@ -369,14 +368,13 @@ static irqreturn_t aha1542_interrupt(int irq, void *dev_id)
tmp_cmd = aha1542->int_cmds[mbo]; tmp_cmd = aha1542->int_cmds[mbo];
if (!tmp_cmd || !tmp_cmd->scsi_done) { if (!tmp_cmd) {
spin_unlock_irqrestore(sh->host_lock, flags); spin_unlock_irqrestore(sh->host_lock, flags);
shost_printk(KERN_WARNING, sh, "Unexpected interrupt\n"); shost_printk(KERN_WARNING, sh, "Unexpected interrupt\n");
shost_printk(KERN_WARNING, sh, "tarstat=%x, hastat=%x idlun=%x ccb#=%d\n", ccb[mbo].tarstat, shost_printk(KERN_WARNING, sh, "tarstat=%x, hastat=%x idlun=%x ccb#=%d\n", ccb[mbo].tarstat,
ccb[mbo].hastat, ccb[mbo].idlun, mbo); ccb[mbo].hastat, ccb[mbo].idlun, mbo);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
my_done = tmp_cmd->scsi_done;
aha1542_free_cmd(tmp_cmd); aha1542_free_cmd(tmp_cmd);
/* /*
* Fetch the sense data, and tuck it away, in the required slot. The * Fetch the sense data, and tuck it away, in the required slot. The
...@@ -410,7 +408,7 @@ static irqreturn_t aha1542_interrupt(int irq, void *dev_id) ...@@ -410,7 +408,7 @@ static irqreturn_t aha1542_interrupt(int irq, void *dev_id)
aha1542->int_cmds[mbo] = NULL; /* This effectively frees up the mailbox slot, as aha1542->int_cmds[mbo] = NULL; /* This effectively frees up the mailbox slot, as
* far as queuecommand is concerned * far as queuecommand is concerned
*/ */
my_done(tmp_cmd); scsi_done(tmp_cmd);
number_serviced++; number_serviced++;
}; };
} }
...@@ -431,7 +429,7 @@ static int aha1542_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *cmd) ...@@ -431,7 +429,7 @@ static int aha1542_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
if (*cmd->cmnd == REQUEST_SENSE) { if (*cmd->cmnd == REQUEST_SENSE) {
/* Don't do the command - we have the sense data already */ /* Don't do the command - we have the sense data already */
cmd->result = 0; cmd->result = 0;
cmd->scsi_done(cmd); scsi_done(cmd);
return 0; return 0;
} }
#ifdef DEBUG #ifdef DEBUG
...@@ -488,7 +486,7 @@ static int aha1542_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *cmd) ...@@ -488,7 +486,7 @@ static int aha1542_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
aha1542->aha1542_last_mbo_used = mbo; aha1542->aha1542_last_mbo_used = mbo;
#ifdef DEBUG #ifdef DEBUG
shost_printk(KERN_DEBUG, sh, "Sending command (%d %p)...", mbo, cmd->scsi_done); shost_printk(KERN_DEBUG, sh, "Sending command (%d)...", mbo);
#endif #endif
/* This gets trashed for some reason */ /* This gets trashed for some reason */
......
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