Skip to contentSkip to conversation

scsi: ufs: Remove unnecessary ret in ufshcd_populate_vreg()

PATCH Applied Yue Hu 2 participants 2 messages Mar 10, 2021 – Mar 19, 2021 SCSI

lore
Share & tools
lore

Yue Hu

author
#0 lore raw

PATCH 1/1 scsi: ufs: Remove unnecessary ret in ufshcd_populate_vreg()

From: Yue Hu <[email protected]>

The local variable _ret_ is always zero, so we can remove it and just return 0 directly in the end.

---
 drivers/scsi/ufs/ufshcd-pltfrm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/scsi/ufs/ufshcd-pltfrm.c +2 -4
index 1a69949..fedb7de 100644
@@ -106,7 +106,6 @@ static int ufshcd_parse_clock_info(struct ufs_hba *hba)
 static int ufshcd_populate_vreg(struct device *dev, const char *name,
 		struct ufs_vreg **out_vreg)
 {
-	int ret = 0;
 	char prop_name[MAX_PROP_SIZE];
 	struct ufs_vreg *vreg = NULL;
 	struct device_node *np = dev->of_node;
@@ -135,9 +134,8 @@ static int ufshcd_populate_vreg(struct device *dev, const char *name,
 		vreg->max_uA = 0;
 	}
 out:
-	if (!ret)
-		*out_vreg = vreg;
-	return ret;
+	*out_vreg = vreg;
+	return 0;
 }
 
 /**
Signature · 1 line
1.9.1
#1 lore raw
Quoted 2 lines · Yue Hu

The local variable _ret_ is always zero, so we can remove it and just return 0 directly in the end.

Applied to 5.13/scsi-queue, thanks!

[1/1] scsi: ufs: Remove unnecessary ret in ufshcd_populate_vreg()

      https://git.kernel.org/mkp/scsi/c/2a8561b78e37
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering