Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bart Van Assche and committed by
Martin K. Petersen
9dd9b96c 2adf975e

+5 -8
+5 -8
drivers/scsi/3w-xxxx.c
··· 1160 1160 tw_dev->state[request_id] = TW_S_COMPLETED; 1161 1161 tw_state_request_finish(tw_dev, request_id); 1162 1162 tw_dev->srb[request_id]->result = (DID_OK << 16); 1163 - tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]); 1163 + scsi_done(tw_dev->srb[request_id]); 1164 1164 } 1165 1165 command_packet->byte8.param.sgl[0].address = param_value; 1166 1166 command_packet->byte8.param.sgl[0].length = sizeof(TW_Sector); ··· 1305 1305 if (srb != NULL) { 1306 1306 srb->result = (DID_RESET << 16); 1307 1307 scsi_dma_unmap(srb); 1308 - srb->scsi_done(srb); 1308 + scsi_done(srb); 1309 1309 } 1310 1310 } 1311 1311 } ··· 1505 1505 tw_dev->state[request_id] = TW_S_COMPLETED; 1506 1506 tw_state_request_finish(tw_dev, request_id); 1507 1507 tw_dev->srb[request_id]->result = (DID_OK << 16); 1508 - tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]); 1508 + scsi_done(tw_dev->srb[request_id]); 1509 1509 return 0; 1510 1510 } 1511 1511 ··· 1796 1796 1797 1797 /* If we got a request_sense, we probably want a reset, return error */ 1798 1798 tw_dev->srb[request_id]->result = (DID_ERROR << 16); 1799 - tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]); 1799 + scsi_done(tw_dev->srb[request_id]); 1800 1800 1801 1801 return 0; 1802 1802 } /* End tw_scsiop_request_sense() */ ··· 1928 1928 /* If we are resetting due to timed out ioctl, report as busy */ 1929 1929 if (test_bit(TW_IN_RESET, &tw_dev->flags)) 1930 1930 return SCSI_MLQUEUE_HOST_BUSY; 1931 - 1932 - /* Save done function into struct scsi_cmnd */ 1933 - SCpnt->scsi_done = done; 1934 1931 1935 1932 /* Queue the command and get a request id */ 1936 1933 tw_state_request_start(tw_dev, &request_id); ··· 2162 2165 /* Now complete the io */ 2163 2166 if ((error != TW_ISR_DONT_COMPLETE)) { 2164 2167 scsi_dma_unmap(tw_dev->srb[request_id]); 2165 - tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]); 2168 + scsi_done(tw_dev->srb[request_id]); 2166 2169 tw_dev->state[request_id] = TW_S_COMPLETED; 2167 2170 tw_state_request_finish(tw_dev, request_id); 2168 2171 tw_dev->posted_request_count--;