scsi: wd33c93: Call scsi_done() directly

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

Link: https://lore.kernel.org/r/20211007204618.2196847-4-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Bart Van Assche 2021-10-07 13:46:04 -07:00 committed by Martin K. Petersen
parent aeb2627dcf
commit 9c4f6be7dd

View File

@ -376,11 +376,9 @@ wd33c93_queuecommand_lck(struct scsi_cmnd *cmd,
/* Set up a few fields in the scsi_cmnd structure for our own use: /* Set up a few fields in the scsi_cmnd structure for our own use:
* - host_scribble is the pointer to the next cmd in the input queue * - host_scribble is the pointer to the next cmd in the input queue
* - scsi_done points to the routine we call when a cmd is finished
* - result is what you'd expect * - result is what you'd expect
*/ */
cmd->host_scribble = NULL; cmd->host_scribble = NULL;
cmd->scsi_done = done;
cmd->result = 0; cmd->result = 0;
/* We use the Scsi_Pointer structure that's included with each command /* We use the Scsi_Pointer structure that's included with each command
@ -856,7 +854,7 @@ wd33c93_intr(struct Scsi_Host *instance)
cmd->result = DID_NO_CONNECT << 16; cmd->result = DID_NO_CONNECT << 16;
hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff));
hostdata->state = S_UNCONNECTED; hostdata->state = S_UNCONNECTED;
cmd->scsi_done(cmd); scsi_done(cmd);
/* From esp.c: /* From esp.c:
* There is a window of time within the scsi_done() path * There is a window of time within the scsi_done() path
@ -1183,7 +1181,7 @@ wd33c93_intr(struct Scsi_Host *instance)
scsi_msg_to_host_byte(cmd, cmd->SCp.Message); scsi_msg_to_host_byte(cmd, cmd->SCp.Message);
set_status_byte(cmd, cmd->SCp.Status); set_status_byte(cmd, cmd->SCp.Status);
} }
cmd->scsi_done(cmd); scsi_done(cmd);
/* We are no longer connected to a target - check to see if /* We are no longer connected to a target - check to see if
* there are commands waiting to be executed. * there are commands waiting to be executed.
@ -1270,7 +1268,7 @@ wd33c93_intr(struct Scsi_Host *instance)
scsi_msg_to_host_byte(cmd, cmd->SCp.Message); scsi_msg_to_host_byte(cmd, cmd->SCp.Message);
set_status_byte(cmd, cmd->SCp.Status); set_status_byte(cmd, cmd->SCp.Status);
} }
cmd->scsi_done(cmd); scsi_done(cmd);
/* We are no longer connected to a target - check to see if /* We are no longer connected to a target - check to see if
* there are commands waiting to be executed. * there are commands waiting to be executed.
@ -1306,7 +1304,7 @@ wd33c93_intr(struct Scsi_Host *instance)
scsi_msg_to_host_byte(cmd, cmd->SCp.Message); scsi_msg_to_host_byte(cmd, cmd->SCp.Message);
set_status_byte(cmd, cmd->SCp.Status); set_status_byte(cmd, cmd->SCp.Status);
} }
cmd->scsi_done(cmd); scsi_done(cmd);
break; break;
case S_PRE_TMP_DISC: case S_PRE_TMP_DISC:
case S_RUNNING_LEVEL2: case S_RUNNING_LEVEL2:
@ -1636,7 +1634,7 @@ wd33c93_abort(struct scsi_cmnd * cmd)
("scsi%d: Abort - removing command from input_Q. ", ("scsi%d: Abort - removing command from input_Q. ",
instance->host_no); instance->host_no);
enable_irq(cmd->device->host->irq); enable_irq(cmd->device->host->irq);
cmd->scsi_done(cmd); scsi_done(cmd);
return SUCCESS; return SUCCESS;
} }
prev = tmp; prev = tmp;
@ -1711,7 +1709,7 @@ wd33c93_abort(struct scsi_cmnd * cmd)
wd33c93_execute(instance); wd33c93_execute(instance);
enable_irq(cmd->device->host->irq); enable_irq(cmd->device->host->irq);
cmd->scsi_done(cmd); scsi_done(cmd);
return SUCCESS; return SUCCESS;
} }