diff options
author | Bart Van Assche | 2021-10-07 13:28:05 -0700 |
---|---|---|
committer | Martin K. Petersen | 2021-10-16 21:28:44 -0400 |
commit | 9dd9b96c2623442d9999c67a2cc8f58d64a110d5 (patch) | |
tree | 980e89e500851452b8737d0f3a18117c25a5037b /drivers/scsi/3w-xxxx.c | |
parent | 2adf975e899a35936b89047d3a02c582ef11adeb (diff) |
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>
Diffstat (limited to 'drivers/scsi/3w-xxxx.c')
-rw-r--r-- | drivers/scsi/3w-xxxx.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c index 4ee485ab2714..bdd3ab8875e2 100644 --- a/drivers/scsi/3w-xxxx.c +++ b/drivers/scsi/3w-xxxx.c @@ -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--; |