From eadb989dc03293048fa1d5548cab07b16ad9d227 Mon Sep 17 00:00:00 2001 From: Yue Hu Date: Fri, 19 Mar 2021 15:09:16 +0800 Subject: [PATCH] UPSTREAM: scsi: ufs: Remove unnecessary NULL checks in ufshcd_find_max_sup_active_icc_level() vcc/vccq/vccq2 have already been NULL checked at this point in ufshcd_find_max_sup_active_icc_level(). Link: https://lore.kernel.org/r/20210319070916.2254-1-zbestahu@gmail.com Signed-off-by: Yue Hu Signed-off-by: Martin K. Petersen (cherry picked from commit 0873045f63c474db5c9f816a01fb1a7f64ea21b2) Bug: 204438323 Change-Id: I921b32f3bf880ae5e9997f2dd3f0515378fb2c79 Signed-off-by: Bart Van Assche --- drivers/scsi/ufs/ufshcd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index d3645da87221..9dc8eaf865c7 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -7254,19 +7254,19 @@ static u32 ufshcd_find_max_sup_active_icc_level(struct ufs_hba *hba, goto out; } - if (hba->vreg_info.vcc && hba->vreg_info.vcc->max_uA) + if (hba->vreg_info.vcc->max_uA) icc_level = ufshcd_get_max_icc_level( hba->vreg_info.vcc->max_uA, POWER_DESC_MAX_ACTV_ICC_LVLS - 1, &desc_buf[PWR_DESC_ACTIVE_LVLS_VCC_0]); - if (hba->vreg_info.vccq && hba->vreg_info.vccq->max_uA) + if (hba->vreg_info.vccq->max_uA) icc_level = ufshcd_get_max_icc_level( hba->vreg_info.vccq->max_uA, icc_level, &desc_buf[PWR_DESC_ACTIVE_LVLS_VCCQ_0]); - if (hba->vreg_info.vccq2 && hba->vreg_info.vccq2->max_uA) + if (hba->vreg_info.vccq2->max_uA) icc_level = ufshcd_get_max_icc_level( hba->vreg_info.vccq2->max_uA, icc_level,