scsi: 3w-xxxx: Call scsi_done() directly
Conditional statements are faster than indirect calls. Hence call scsi_done() directly. Link: https://lore.kernel.org/r/20211007202923.2174984-11-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:
parent
2adf975e89
commit
9dd9b96c26
@ -1160,7 +1160,7 @@ static int tw_setfeature(TW_Device_Extension *tw_dev, int parm, int param_size,
|
||||
tw_dev->state[request_id] = TW_S_COMPLETED;
|
||||
tw_state_request_finish(tw_dev, request_id);
|
||||
tw_dev->srb[request_id]->result = (DID_OK << 16);
|
||||
tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);
|
||||
scsi_done(tw_dev->srb[request_id]);
|
||||
}
|
||||
command_packet->byte8.param.sgl[0].address = param_value;
|
||||
command_packet->byte8.param.sgl[0].length = sizeof(TW_Sector);
|
||||
@ -1305,7 +1305,7 @@ static int tw_reset_device_extension(TW_Device_Extension *tw_dev)
|
||||
if (srb != NULL) {
|
||||
srb->result = (DID_RESET << 16);
|
||||
scsi_dma_unmap(srb);
|
||||
srb->scsi_done(srb);
|
||||
scsi_done(srb);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1505,7 +1505,7 @@ static int tw_scsiop_mode_sense(TW_Device_Extension *tw_dev, int request_id)
|
||||
tw_dev->state[request_id] = TW_S_COMPLETED;
|
||||
tw_state_request_finish(tw_dev, request_id);
|
||||
tw_dev->srb[request_id]->result = (DID_OK << 16);
|
||||
tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);
|
||||
scsi_done(tw_dev->srb[request_id]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1796,7 +1796,7 @@ static int tw_scsiop_request_sense(TW_Device_Extension *tw_dev, int request_id)
|
||||
|
||||
/* If we got a request_sense, we probably want a reset, return error */
|
||||
tw_dev->srb[request_id]->result = (DID_ERROR << 16);
|
||||
tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);
|
||||
scsi_done(tw_dev->srb[request_id]);
|
||||
|
||||
return 0;
|
||||
} /* End tw_scsiop_request_sense() */
|
||||
@ -1929,9 +1929,6 @@ static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_c
|
||||
if (test_bit(TW_IN_RESET, &tw_dev->flags))
|
||||
return SCSI_MLQUEUE_HOST_BUSY;
|
||||
|
||||
/* Save done function into struct scsi_cmnd */
|
||||
SCpnt->scsi_done = done;
|
||||
|
||||
/* Queue the command and get a request id */
|
||||
tw_state_request_start(tw_dev, &request_id);
|
||||
|
||||
@ -2165,7 +2162,7 @@ static irqreturn_t tw_interrupt(int irq, void *dev_instance)
|
||||
/* Now complete the io */
|
||||
if ((error != TW_ISR_DONT_COMPLETE)) {
|
||||
scsi_dma_unmap(tw_dev->srb[request_id]);
|
||||
tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);
|
||||
scsi_done(tw_dev->srb[request_id]);
|
||||
tw_dev->state[request_id] = TW_S_COMPLETED;
|
||||
tw_state_request_finish(tw_dev, request_id);
|
||||
tw_dev->posted_request_count--;
|
||||
|
Loading…
Reference in New Issue
Block a user