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

scsi: mesh: Call scsi_done() directly

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

Link: https://lore.kernel.org/r/20211007202923.2174984-51-bvanassche@acm.orgSigned-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 9e060365
...@@ -342,15 +342,6 @@ static inline void mesh_flush_io(volatile struct mesh_regs __iomem *mr) ...@@ -342,15 +342,6 @@ static inline void mesh_flush_io(volatile struct mesh_regs __iomem *mr)
} }
/*
* Complete a SCSI command
*/
static void mesh_completed(struct mesh_state *ms, struct scsi_cmnd *cmd)
{
(*cmd->scsi_done)(cmd);
}
/* Called with meshinterrupt disabled, initialize the chipset /* Called with meshinterrupt disabled, initialize the chipset
* and eventually do the initial bus reset. The lock must not be * and eventually do the initial bus reset. The lock must not be
* held since we can schedule. * held since we can schedule.
...@@ -613,7 +604,7 @@ static void mesh_done(struct mesh_state *ms, int start_next) ...@@ -613,7 +604,7 @@ static void mesh_done(struct mesh_state *ms, int start_next)
#endif #endif
} }
cmd->SCp.this_residual -= ms->data_ptr; cmd->SCp.this_residual -= ms->data_ptr;
mesh_completed(ms, cmd); scsi_done(cmd);
} }
if (start_next) { if (start_next) {
out_8(&ms->mesh->sequence, SEQ_ENBRESEL); out_8(&ms->mesh->sequence, SEQ_ENBRESEL);
...@@ -996,7 +987,7 @@ static void handle_reset(struct mesh_state *ms) ...@@ -996,7 +987,7 @@ static void handle_reset(struct mesh_state *ms)
if ((cmd = tp->current_req) != NULL) { if ((cmd = tp->current_req) != NULL) {
set_host_byte(cmd, DID_RESET); set_host_byte(cmd, DID_RESET);
tp->current_req = NULL; tp->current_req = NULL;
mesh_completed(ms, cmd); scsi_done(cmd);
} }
ms->tgts[tgt].sdtr_state = do_sdtr; ms->tgts[tgt].sdtr_state = do_sdtr;
ms->tgts[tgt].sync_params = ASYNC_PARAMS; ms->tgts[tgt].sync_params = ASYNC_PARAMS;
...@@ -1005,7 +996,7 @@ static void handle_reset(struct mesh_state *ms) ...@@ -1005,7 +996,7 @@ static void handle_reset(struct mesh_state *ms)
while ((cmd = ms->request_q) != NULL) { while ((cmd = ms->request_q) != NULL) {
ms->request_q = (struct scsi_cmnd *) cmd->host_scribble; ms->request_q = (struct scsi_cmnd *) cmd->host_scribble;
set_host_byte(cmd, DID_RESET); set_host_byte(cmd, DID_RESET);
mesh_completed(ms, cmd); scsi_done(cmd);
} }
ms->phase = idle; ms->phase = idle;
ms->msgphase = msg_none; ms->msgphase = msg_none;
...@@ -1634,7 +1625,6 @@ static int mesh_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd * ...@@ -1634,7 +1625,6 @@ static int mesh_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *
{ {
struct mesh_state *ms; struct mesh_state *ms;
cmd->scsi_done = done;
cmd->host_scribble = NULL; cmd->host_scribble = NULL;
ms = (struct mesh_state *) cmd->device->host->hostdata; ms = (struct mesh_state *) cmd->device->host->hostdata;
......
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