Commit afcd609e authored by Colin Ian King's avatar Colin Ian King Committed by Martin K. Petersen

scsi: pm80xx: remove redundant assignments to variable rc

There are several occasions where variable rc is being initialized with a
value that is never read and error is being re-assigned a little later on.
Clean up the code by removing rc entirely and just returning the return
value from the call to pm8001_issue_ssp_tmf

Addresses-Coverity: ("Unused value")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarJack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent a5ac1f5d
...@@ -1308,28 +1308,22 @@ int pm8001_abort_task(struct sas_task *task) ...@@ -1308,28 +1308,22 @@ int pm8001_abort_task(struct sas_task *task)
int pm8001_abort_task_set(struct domain_device *dev, u8 *lun) int pm8001_abort_task_set(struct domain_device *dev, u8 *lun)
{ {
int rc = TMF_RESP_FUNC_FAILED;
struct pm8001_tmf_task tmf_task; struct pm8001_tmf_task tmf_task;
tmf_task.tmf = TMF_ABORT_TASK_SET; tmf_task.tmf = TMF_ABORT_TASK_SET;
rc = pm8001_issue_ssp_tmf(dev, lun, &tmf_task); return pm8001_issue_ssp_tmf(dev, lun, &tmf_task);
return rc;
} }
int pm8001_clear_aca(struct domain_device *dev, u8 *lun) int pm8001_clear_aca(struct domain_device *dev, u8 *lun)
{ {
int rc = TMF_RESP_FUNC_FAILED;
struct pm8001_tmf_task tmf_task; struct pm8001_tmf_task tmf_task;
tmf_task.tmf = TMF_CLEAR_ACA; tmf_task.tmf = TMF_CLEAR_ACA;
rc = pm8001_issue_ssp_tmf(dev, lun, &tmf_task); return pm8001_issue_ssp_tmf(dev, lun, &tmf_task);
return rc;
} }
int pm8001_clear_task_set(struct domain_device *dev, u8 *lun) int pm8001_clear_task_set(struct domain_device *dev, u8 *lun)
{ {
int rc = TMF_RESP_FUNC_FAILED;
struct pm8001_tmf_task tmf_task; struct pm8001_tmf_task tmf_task;
struct pm8001_device *pm8001_dev = dev->lldd_dev; struct pm8001_device *pm8001_dev = dev->lldd_dev;
struct pm8001_hba_info *pm8001_ha = pm8001_find_ha_by_dev(dev); struct pm8001_hba_info *pm8001_ha = pm8001_find_ha_by_dev(dev);
...@@ -1338,7 +1332,6 @@ int pm8001_clear_task_set(struct domain_device *dev, u8 *lun) ...@@ -1338,7 +1332,6 @@ int pm8001_clear_task_set(struct domain_device *dev, u8 *lun)
pm8001_printk("I_T_L_Q clear task set[%x]\n", pm8001_printk("I_T_L_Q clear task set[%x]\n",
pm8001_dev->device_id)); pm8001_dev->device_id));
tmf_task.tmf = TMF_CLEAR_TASK_SET; tmf_task.tmf = TMF_CLEAR_TASK_SET;
rc = pm8001_issue_ssp_tmf(dev, lun, &tmf_task); return pm8001_issue_ssp_tmf(dev, lun, &tmf_task);
return rc;
} }
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