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

scsi: NCR5380: Call scsi_done() directly

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

Link: https://lore.kernel.org/r/20211007202923.2174984-14-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
117cd238 0800a26a

+6 -6
+6 -6
drivers/scsi/NCR5380.c
··· 547 547 hostdata->sensing = NULL; 548 548 } 549 549 550 - cmd->scsi_done(cmd); 550 + scsi_done(cmd); 551 551 } 552 552 553 553 /** ··· 573 573 case WRITE_10: 574 574 shost_printk(KERN_DEBUG, instance, "WRITE attempted with NDEBUG_NO_WRITE set\n"); 575 575 cmd->result = (DID_ERROR << 16); 576 - cmd->scsi_done(cmd); 576 + scsi_done(cmd); 577 577 return 0; 578 578 } 579 579 #endif /* (NDEBUG & NDEBUG_NO_WRITE) */ ··· 960 960 * hostdata->connected will be set to cmd. 961 961 * SELECT interrupt will be disabled. 962 962 * 963 - * If failed (no target) : cmd->scsi_done() will be called, and the 963 + * If failed (no target) : scsi_done() will be called, and the 964 964 * cmd->result host byte set to DID_BAD_TARGET. 965 965 */ 966 966 ··· 2262 2262 dsprintk(NDEBUG_ABORT, instance, 2263 2263 "abort: removed %p from issue queue\n", cmd); 2264 2264 cmd->result = DID_ABORT << 16; 2265 - cmd->scsi_done(cmd); /* No tag or busy flag to worry about */ 2265 + scsi_done(cmd); /* No tag or busy flag to worry about */ 2266 2266 goto out; 2267 2267 } 2268 2268 ··· 2357 2357 list_for_each_entry(ncmd, &hostdata->autosense, list) { 2358 2358 struct scsi_cmnd *cmd = NCR5380_to_scmd(ncmd); 2359 2359 2360 - cmd->scsi_done(cmd); 2360 + scsi_done(cmd); 2361 2361 } 2362 2362 INIT_LIST_HEAD(&hostdata->autosense); 2363 2363 ··· 2400 2400 struct scsi_cmnd *scmd = NCR5380_to_scmd(ncmd); 2401 2401 2402 2402 scmd->result = DID_RESET << 16; 2403 - scmd->scsi_done(scmd); 2403 + scsi_done(scmd); 2404 2404 } 2405 2405 INIT_LIST_HEAD(&hostdata->unissued); 2406 2406