summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorZeng Guangyue <zengguangyue@hisilicon.com>2019-03-30 17:03:13 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2019-04-03 23:45:59 -0400
commit60b7b823fb4158d89e5d4ca798c219bd97639a73 (patch)
treecb62f3ec1514f9c051e72c3823057143b790d85a /drivers
parent6087550338ad03f369eaddc1b995c0751a0a68ab (diff)
scsi: ufs: remove unnecessary pointer evaluation
The pointer value is initialized as &hba->vreg_info, and it's never changed. It's not necessary to check the pointer is null or not. Signed-off-by: Zeng Guangyue <zengguangyue@hisilicon.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/ufs/ufshcd.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 5ba49c8cd2a3..b9a3d6784abf 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -7115,9 +7115,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;
@@ -7143,10 +7140,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)
@@ -7172,9 +7166,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;