Commit f13cc234 authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: pmcraid: Call scsi_done() directly

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

Link: https://lore.kernel.org/r/20211007202923.2174984-61-bvanassche@acm.orgSigned-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent ca0d62d2
...@@ -837,7 +837,7 @@ static void pmcraid_erp_done(struct pmcraid_cmd *cmd) ...@@ -837,7 +837,7 @@ static void pmcraid_erp_done(struct pmcraid_cmd *cmd)
scsi_dma_unmap(scsi_cmd); scsi_dma_unmap(scsi_cmd);
pmcraid_return_cmd(cmd); pmcraid_return_cmd(cmd);
scsi_cmd->scsi_done(scsi_cmd); scsi_done(scsi_cmd);
} }
/** /**
...@@ -2017,7 +2017,7 @@ static void pmcraid_fail_outstanding_cmds(struct pmcraid_instance *pinstance) ...@@ -2017,7 +2017,7 @@ static void pmcraid_fail_outstanding_cmds(struct pmcraid_instance *pinstance)
le32_to_cpu(resp) >> 2, le32_to_cpu(resp) >> 2,
cmd->ioa_cb->ioarcb.cdb[0], cmd->ioa_cb->ioarcb.cdb[0],
scsi_cmd->result); scsi_cmd->result);
scsi_cmd->scsi_done(scsi_cmd); scsi_done(scsi_cmd);
} else if (cmd->cmd_done == pmcraid_internal_done || } else if (cmd->cmd_done == pmcraid_internal_done ||
cmd->cmd_done == pmcraid_erp_done) { cmd->cmd_done == pmcraid_erp_done) {
cmd->cmd_done(cmd); cmd->cmd_done(cmd);
...@@ -2814,7 +2814,7 @@ static int _pmcraid_io_done(struct pmcraid_cmd *cmd, int reslen, int ioasc) ...@@ -2814,7 +2814,7 @@ static int _pmcraid_io_done(struct pmcraid_cmd *cmd, int reslen, int ioasc)
if (rc == 0) { if (rc == 0) {
scsi_dma_unmap(scsi_cmd); scsi_dma_unmap(scsi_cmd);
scsi_cmd->scsi_done(scsi_cmd); scsi_done(scsi_cmd);
} }
return rc; return rc;
...@@ -3328,7 +3328,6 @@ static int pmcraid_queuecommand_lck( ...@@ -3328,7 +3328,6 @@ static int pmcraid_queuecommand_lck(
pinstance = pinstance =
(struct pmcraid_instance *)scsi_cmd->device->host->hostdata; (struct pmcraid_instance *)scsi_cmd->device->host->hostdata;
fw_version = be16_to_cpu(pinstance->inq_data->fw_version); fw_version = be16_to_cpu(pinstance->inq_data->fw_version);
scsi_cmd->scsi_done = done;
res = scsi_cmd->device->hostdata; res = scsi_cmd->device->hostdata;
scsi_cmd->result = (DID_OK << 16); scsi_cmd->result = (DID_OK << 16);
...@@ -3338,7 +3337,7 @@ static int pmcraid_queuecommand_lck( ...@@ -3338,7 +3337,7 @@ static int pmcraid_queuecommand_lck(
if (pinstance->ioa_state == IOA_STATE_DEAD) { if (pinstance->ioa_state == IOA_STATE_DEAD) {
pmcraid_info("IOA is dead, but queuecommand is scheduled\n"); pmcraid_info("IOA is dead, but queuecommand is scheduled\n");
scsi_cmd->result = (DID_NO_CONNECT << 16); scsi_cmd->result = (DID_NO_CONNECT << 16);
scsi_cmd->scsi_done(scsi_cmd); scsi_done(scsi_cmd);
return 0; return 0;
} }
...@@ -3351,7 +3350,7 @@ static int pmcraid_queuecommand_lck( ...@@ -3351,7 +3350,7 @@ static int pmcraid_queuecommand_lck(
*/ */
if (scsi_cmd->cmnd[0] == SYNCHRONIZE_CACHE) { if (scsi_cmd->cmnd[0] == SYNCHRONIZE_CACHE) {
pmcraid_info("SYNC_CACHE(0x35), completing in driver itself\n"); pmcraid_info("SYNC_CACHE(0x35), completing in driver itself\n");
scsi_cmd->scsi_done(scsi_cmd); scsi_done(scsi_cmd);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment