Commit 60b7b823 authored by Zeng Guangyue's avatar Zeng Guangyue Committed by Martin K. Petersen
Browse files

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: default avatarZeng Guangyue <zengguangyue@hisilicon.com>
Acked-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 60875503
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -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;
}

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;