diff mbox series

coresight: not judge pointer

Message ID 20190116062444.92031-1-zengguangyue@hisilicon.com
State New
Headers show
Series coresight: not judge pointer | expand

Commit Message

Zeng Guangyue Jan. 16, 2019, 6:24 a.m. UTC
From: z00486613 <z00486613@notesmail.huawei.com>


As a member of struct ufs_hba, the &hba->vreg_info
will never be null, so there is no need the judge the pointer
is null or not.

Signed-off-by: z00486613 <z00486613@notesmail.huawei.com>

---
 drivers/scsi/ufs/ufshcd.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

-- 
2.20.GIT
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 9ba7671b84f8..c729a9969aec 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -7109,9 +7109,6 @@  static int ufshcd_setup_vreg(struct ufs_hba *hba, bool on)
 	struct device *dev = hba->dev;
 	struct ufs_vreg_info *info = &hba->vreg_info;
 
-	if (!info)
-		goto out;
-
 	ret = ufshcd_toggle_vreg(dev, info->vcc, on);
 	if (ret)
 		goto out;
@@ -7137,10 +7134,7 @@  static int ufshcd_setup_hba_vreg(struct ufs_hba *hba, bool on)
 {
 	struct ufs_vreg_info *info = &hba->vreg_info;
 
-	if (info)
-		return ufshcd_toggle_vreg(hba->dev, info->vdd_hba, on);
-
-	return 0;
+	return ufshcd_toggle_vreg(hba->dev, info->vdd_hba, on);
 }
 
 static int ufshcd_get_vreg(struct device *dev, struct ufs_vreg *vreg)
@@ -7166,9 +7160,6 @@  static int ufshcd_init_vreg(struct ufs_hba *hba)
 	struct device *dev = hba->dev;
 	struct ufs_vreg_info *info = &hba->vreg_info;
 
-	if (!info)
-		goto out;
-
 	ret = ufshcd_get_vreg(dev, info->vcc);
 	if (ret)
 		goto out;
@@ -7197,9 +7188,7 @@  static int ufshcd_set_vccq_rail_unused(struct ufs_hba *hba, bool unused)
 	int ret = 0;
 	struct ufs_vreg_info *info = &hba->vreg_info;
 
-	if (!info)
-		goto out;
-	else if (!info->vccq)
+	if (!info->vccq)
 		goto out;
 
 	if (unused) {