diff mbox series

[RESEND] scsi: ufs-mediatek: Correct operator & -> &&

Message ID 1615896915-148864-1-git-send-email-dj0227@163.com
State New
Headers show
Series [RESEND] scsi: ufs-mediatek: Correct operator & -> && | expand

Commit Message

Jian Dong March 16, 2021, 12:15 p.m. UTC
From: dongjian <dongjian@yulong.com>

The "lpm" and "->enabled" are all bool type, it should be using
operator && rather than bit operator.

Fixes: 488edafb1120 (scsi: ufs-mediatek: Introduce low-power mode for device power supply)

Signed-off-by: dongjian <dongjian@yulong.com>
Signed-off-by: Yue Hu <huyue2@yulong.com>
---
 drivers/scsi/ufs/ufs-mediatek.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Avri Altman March 16, 2021, 1:54 p.m. UTC | #1
> From: dongjian <dongjian@yulong.com>
> 
> The "lpm" and "->enabled" are all bool type, it should be using
> operator && rather than bit operator.
> 
> Fixes: 488edafb1120 (scsi: ufs-mediatek: Introduce low-power mode for device
> power supply)
> 
> Signed-off-by: dongjian <dongjian@yulong.com>
> Signed-off-by: Yue Hu <huyue2@yulong.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>


> ---
>  drivers/scsi/ufs/ufs-mediatek.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c
> index c55202b..a981f26 100644
> --- a/drivers/scsi/ufs/ufs-mediatek.c
> +++ b/drivers/scsi/ufs/ufs-mediatek.c
> @@ -911,7 +911,7 @@ static void ufs_mtk_vreg_set_lpm(struct ufs_hba
> *hba, bool lpm)
>         if (!hba->vreg_info.vccq2 || !hba->vreg_info.vcc)
>                 return;
> 
> -       if (lpm & !hba->vreg_info.vcc->enabled)
> +       if (lpm && !hba->vreg_info.vcc->enabled)
>                 regulator_set_mode(hba->vreg_info.vccq2->reg,
>                                    REGULATOR_MODE_IDLE);
>         else if (!lpm)
> --
> 1.9.1
>
Martin K. Petersen March 19, 2021, 3:45 a.m. UTC | #2
On Tue, 16 Mar 2021 20:15:15 +0800, Jian Dong wrote:

> The "lpm" and "->enabled" are all bool type, it should be using

> operator && rather than bit operator.

> 

> Fixes: 488edafb1120 (scsi: ufs-mediatek: Introduce low-power mode for device power supply)


Applied to 5.12/scsi-fixes, thanks!

[1/1] scsi: ufs-mediatek: Correct operator & -> &&
      https://git.kernel.org/mkp/scsi/c/0fdc7d5d8f37

-- 
Martin K. Petersen	Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c
index c55202b..a981f26 100644
--- a/drivers/scsi/ufs/ufs-mediatek.c
+++ b/drivers/scsi/ufs/ufs-mediatek.c
@@ -911,7 +911,7 @@  static void ufs_mtk_vreg_set_lpm(struct ufs_hba *hba, bool lpm)
 	if (!hba->vreg_info.vccq2 || !hba->vreg_info.vcc)
 		return;
 
-	if (lpm & !hba->vreg_info.vcc->enabled)
+	if (lpm && !hba->vreg_info.vcc->enabled)
 		regulator_set_mode(hba->vreg_info.vccq2->reg,
 				   REGULATOR_MODE_IDLE);
 	else if (!lpm)