Commit f9a9dee6 authored by Sumit Saxena's avatar Sumit Saxena Committed by Martin K. Petersen

megaraid_sas: Code optimization build_and_issue_cmd return-type

build_and_issue_cmd should return SCSI_MLQUEUE_HOST_BUSY for a few error
cases instead of returning 1.
Signed-off-by: default avatarSumit Saxena <sumit.saxena@avagotech.com>
Reviewed-by: default avatarTomas Henzl <thenzl@redhat.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 179ac142
...@@ -1636,7 +1636,7 @@ megasas_build_and_issue_cmd(struct megasas_instance *instance, ...@@ -1636,7 +1636,7 @@ megasas_build_and_issue_cmd(struct megasas_instance *instance,
return 0; return 0;
out_return_cmd: out_return_cmd:
megasas_return_cmd(instance, cmd); megasas_return_cmd(instance, cmd);
return 1; return SCSI_MLQUEUE_HOST_BUSY;
} }
...@@ -1728,12 +1728,7 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd) ...@@ -1728,12 +1728,7 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
break; break;
} }
if (instance->instancet->build_and_issue_cmd(instance, scmd)) { return instance->instancet->build_and_issue_cmd(instance, scmd);
dev_err(&instance->pdev->dev, "Err returned from build_and_issue_cmd\n");
return SCSI_MLQUEUE_HOST_BUSY;
}
return 0;
out_done: out_done:
scmd->scsi_done(scmd); scmd->scsi_done(scmd);
......
...@@ -2125,7 +2125,7 @@ megasas_build_and_issue_cmd_fusion(struct megasas_instance *instance, ...@@ -2125,7 +2125,7 @@ megasas_build_and_issue_cmd_fusion(struct megasas_instance *instance,
req_desc = megasas_get_request_descriptor(instance, index-1); req_desc = megasas_get_request_descriptor(instance, index-1);
if (!req_desc) if (!req_desc)
return 1; return SCSI_MLQUEUE_HOST_BUSY;
req_desc->Words = 0; req_desc->Words = 0;
cmd->request_desc = req_desc; cmd->request_desc = req_desc;
...@@ -2134,7 +2134,7 @@ megasas_build_and_issue_cmd_fusion(struct megasas_instance *instance, ...@@ -2134,7 +2134,7 @@ megasas_build_and_issue_cmd_fusion(struct megasas_instance *instance,
megasas_return_cmd_fusion(instance, cmd); megasas_return_cmd_fusion(instance, cmd);
dev_err(&instance->pdev->dev, "Error building command\n"); dev_err(&instance->pdev->dev, "Error building command\n");
cmd->request_desc = NULL; cmd->request_desc = NULL;
return 1; return SCSI_MLQUEUE_HOST_BUSY;
} }
req_desc = cmd->request_desc; req_desc = cmd->request_desc;
......
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