scsi: megaraid_sas: Simplify megasas_update_device_list

Remove unnecessary dcmd_ret check and goto statement.

Link: https://lore.kernel.org/r/1663145283-4872-4-git-send-email-kanie@linux.alibaba.com
Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Guixin Liu 2022-09-14 16:48:01 +08:00 committed by Martin K. Petersen
parent 9b201b5dff
commit 17883cd59f
1 changed files with 5 additions and 12 deletions

View File

@ -8768,33 +8768,26 @@ static
int megasas_update_device_list(struct megasas_instance *instance,
int event_type)
{
int dcmd_ret = DCMD_SUCCESS;
int dcmd_ret;
if (instance->enable_fw_dev_list) {
dcmd_ret = megasas_host_device_list_query(instance, false);
if (dcmd_ret != DCMD_SUCCESS)
goto out;
return megasas_host_device_list_query(instance, false);
} else {
if (event_type & SCAN_PD_CHANNEL) {
dcmd_ret = megasas_get_pd_list(instance);
if (dcmd_ret != DCMD_SUCCESS)
goto out;
return dcmd_ret;
}
if (event_type & SCAN_VD_CHANNEL) {
if (!instance->requestorId ||
megasas_get_ld_vf_affiliation(instance, 0)) {
dcmd_ret = megasas_ld_list_query(instance,
return megasas_ld_list_query(instance,
MR_LD_QUERY_TYPE_EXPOSED_TO_HOST);
if (dcmd_ret != DCMD_SUCCESS)
goto out;
}
}
}
out:
return dcmd_ret;
return DCMD_SUCCESS;
}
/**