diff mbox series

[3/5] scsi: megaraid_sas: simplify the megasas_update_device_list

Message ID 1663145283-4872-4-git-send-email-kanie@linux.alibaba.com
State New
Headers show
Series scsi: megaraid_sas: some bug fixes and cod cleanup | expand

Commit Message

Guixin Liu Sept. 14, 2022, 8:48 a.m. UTC
Remove unnecessary dcmd_ret check and go to statements.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

Comments

Sumit Saxena Sept. 28, 2022, 11:04 a.m. UTC | #1
On Wed, Sep 14, 2022 at 2:18 PM Guixin Liu <kanie@linux.alibaba.com> wrote:
>
> Remove unnecessary dcmd_ret check and go to statements.
>
> Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>
diff mbox series

Patch

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 4973c9c..1ac33b1 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -8766,33 +8766,26 @@  static inline void megasas_remove_scsi_device(struct scsi_device *sdev)
 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;
 }
 
 /**