linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] scsi: ufs: Remove unnecessary null checks in ufshcd_find_max_sup_active_icc_level()
@ 2021-03-19  7:09 Yue Hu
  2021-03-30  3:54 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Yue Hu @ 2021-03-19  7:09 UTC (permalink / raw)
  To: martin.petersen, avri.altman, jejb, alim.akhtar, linux-scsi
  Cc: linux-kernel, huyue2, zbestahu

From: Yue Hu <huyue2@yulong.com>

Since vcc/vccq/vccq2 have already been null checked before using.

Signed-off-by: Yue Hu <huyue2@yulong.com>
---
 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 7b3267e..f941bc3 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -7145,19 +7145,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,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND] scsi: ufs: Remove unnecessary null checks in ufshcd_find_max_sup_active_icc_level()
  2021-03-19  7:09 [PATCH RESEND] scsi: ufs: Remove unnecessary null checks in ufshcd_find_max_sup_active_icc_level() Yue Hu
@ 2021-03-30  3:54 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2021-03-30  3:54 UTC (permalink / raw)
  To: alim.akhtar, avri.altman, Yue Hu, linux-scsi, jejb
  Cc: Martin K . Petersen, huyue2, linux-kernel, zbestahu

On Fri, 19 Mar 2021 15:09:16 +0800, Yue Hu wrote:

> Since vcc/vccq/vccq2 have already been null checked before using.

Applied to 5.13/scsi-queue, thanks!

[1/1] scsi: ufs: Remove unnecessary null checks in ufshcd_find_max_sup_active_icc_level()
      https://git.kernel.org/mkp/scsi/c/0873045f63c4

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-30  3:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19  7:09 [PATCH RESEND] scsi: ufs: Remove unnecessary null checks in ufshcd_find_max_sup_active_icc_level() Yue Hu
2021-03-30  3:54 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).