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

scsi: dpt_i2o: Call scsi_done() directly

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

Link: https://lore.kernel.org/r/20211007202923.2174984-30-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
e6ed928e 6c365b88

+4 -7
+4 -7
drivers/scsi/dpt_i2o.c
··· 421 421 adpt_hba* pHba = NULL; 422 422 struct adpt_device* pDev = NULL; /* dpt per device information */ 423 423 424 - cmd->scsi_done = done; 425 424 /* 426 425 * SCSI REQUEST_SENSE commands will be executed automatically by the 427 426 * Host Adapter for any errors, so they should not be executed ··· 430 431 431 432 if ((cmd->cmnd[0] == REQUEST_SENSE) && (cmd->sense_buffer[0] != 0)) { 432 433 cmd->result = (DID_OK << 16); 433 - cmd->scsi_done(cmd); 434 + scsi_done(cmd); 434 435 return 0; 435 436 } 436 437 ··· 455 456 // TODO: if any luns are at this bus, scsi id then fake a TEST_UNIT_READY and INQUIRY response 456 457 // with type 7F (for all luns less than the max for this bus,id) so the lun scan will continue. 457 458 cmd->result = (DID_NO_CONNECT << 16); 458 - cmd->scsi_done(cmd); 459 + scsi_done(cmd); 459 460 return 0; 460 461 } 461 462 cmd->device->hostdata = pDev; ··· 2226 2227 printk(KERN_WARNING"%s: scsi opcode 0x%x not supported.\n", 2227 2228 pHba->name, cmd->cmnd[0]); 2228 2229 cmd->result = (DID_ERROR <<16); 2229 - cmd->scsi_done(cmd); 2230 + scsi_done(cmd); 2230 2231 return 0; 2231 2232 } 2232 2233 } ··· 2450 2451 2451 2452 cmd->result |= (dev_status); 2452 2453 2453 - if(cmd->scsi_done != NULL){ 2454 - cmd->scsi_done(cmd); 2455 - } 2454 + scsi_done(cmd); 2456 2455 } 2457 2456 2458 2457