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

scsi: NCR5380: Call scsi_done() directly

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

Link: https://lore.kernel.org/r/20211007202923.2174984-14-bvanassche@acm.orgSigned-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 0800a26a
...@@ -547,7 +547,7 @@ static void complete_cmd(struct Scsi_Host *instance, ...@@ -547,7 +547,7 @@ static void complete_cmd(struct Scsi_Host *instance,
hostdata->sensing = NULL; hostdata->sensing = NULL;
} }
cmd->scsi_done(cmd); scsi_done(cmd);
} }
/** /**
...@@ -573,7 +573,7 @@ static int NCR5380_queue_command(struct Scsi_Host *instance, ...@@ -573,7 +573,7 @@ static int NCR5380_queue_command(struct Scsi_Host *instance,
case WRITE_10: case WRITE_10:
shost_printk(KERN_DEBUG, instance, "WRITE attempted with NDEBUG_NO_WRITE set\n"); shost_printk(KERN_DEBUG, instance, "WRITE attempted with NDEBUG_NO_WRITE set\n");
cmd->result = (DID_ERROR << 16); cmd->result = (DID_ERROR << 16);
cmd->scsi_done(cmd); scsi_done(cmd);
return 0; return 0;
} }
#endif /* (NDEBUG & NDEBUG_NO_WRITE) */ #endif /* (NDEBUG & NDEBUG_NO_WRITE) */
...@@ -960,7 +960,7 @@ static irqreturn_t __maybe_unused NCR5380_intr(int irq, void *dev_id) ...@@ -960,7 +960,7 @@ static irqreturn_t __maybe_unused NCR5380_intr(int irq, void *dev_id)
* hostdata->connected will be set to cmd. * hostdata->connected will be set to cmd.
* SELECT interrupt will be disabled. * SELECT interrupt will be disabled.
* *
* If failed (no target) : cmd->scsi_done() will be called, and the * If failed (no target) : scsi_done() will be called, and the
* cmd->result host byte set to DID_BAD_TARGET. * cmd->result host byte set to DID_BAD_TARGET.
*/ */
...@@ -2262,7 +2262,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd) ...@@ -2262,7 +2262,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd)
dsprintk(NDEBUG_ABORT, instance, dsprintk(NDEBUG_ABORT, instance,
"abort: removed %p from issue queue\n", cmd); "abort: removed %p from issue queue\n", cmd);
cmd->result = DID_ABORT << 16; cmd->result = DID_ABORT << 16;
cmd->scsi_done(cmd); /* No tag or busy flag to worry about */ scsi_done(cmd); /* No tag or busy flag to worry about */
goto out; goto out;
} }
...@@ -2357,7 +2357,7 @@ static void bus_reset_cleanup(struct Scsi_Host *instance) ...@@ -2357,7 +2357,7 @@ static void bus_reset_cleanup(struct Scsi_Host *instance)
list_for_each_entry(ncmd, &hostdata->autosense, list) { list_for_each_entry(ncmd, &hostdata->autosense, list) {
struct scsi_cmnd *cmd = NCR5380_to_scmd(ncmd); struct scsi_cmnd *cmd = NCR5380_to_scmd(ncmd);
cmd->scsi_done(cmd); scsi_done(cmd);
} }
INIT_LIST_HEAD(&hostdata->autosense); INIT_LIST_HEAD(&hostdata->autosense);
...@@ -2400,7 +2400,7 @@ static int NCR5380_host_reset(struct scsi_cmnd *cmd) ...@@ -2400,7 +2400,7 @@ static int NCR5380_host_reset(struct scsi_cmnd *cmd)
struct scsi_cmnd *scmd = NCR5380_to_scmd(ncmd); struct scsi_cmnd *scmd = NCR5380_to_scmd(ncmd);
scmd->result = DID_RESET << 16; scmd->result = DID_RESET << 16;
scmd->scsi_done(scmd); scsi_done(scmd);
} }
INIT_LIST_HEAD(&hostdata->unissued); INIT_LIST_HEAD(&hostdata->unissued);
......
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