All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs-mediatek: Correct operator & -> &&
@ 2021-03-12  7:14 Jian Dong
  2021-03-16 11:35 ` Avri Altman
  0 siblings, 1 reply; 2+ messages in thread
From: Jian Dong @ 2021-03-12  7:14 UTC (permalink / raw)
  To: stanley.chu, jejb, martin.petersen, matthias.bgg
  Cc: linux-scsi, huyue2, dongjian

From: dongjian <dongjian@yulong.com>

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

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(-)

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


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

* RE: [PATCH] scsi: ufs-mediatek: Correct operator & -> &&
  2021-03-12  7:14 [PATCH] scsi: ufs-mediatek: Correct operator & -> && Jian Dong
@ 2021-03-16 11:35 ` Avri Altman
  0 siblings, 0 replies; 2+ messages in thread
From: Avri Altman @ 2021-03-16 11:35 UTC (permalink / raw)
  To: Jian Dong, stanley.chu, jejb, martin.petersen, matthias.bgg
  Cc: linux-scsi, huyue2, dongjian

> 
> From: dongjian <dongjian@yulong.com>
> 
> The "lpm" and "->enabled" are all bool type, it should be using
> operator && rather than bit operator.
Maybe fixes tag as well:
Fixes: 488edafb1120 (scsi: ufs-mediatek: Introduce low-power mode for device power supply)

Thanks,
Avri

> 
> 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(-)
> 
> 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


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

end of thread, other threads:[~2021-03-16 11:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12  7:14 [PATCH] scsi: ufs-mediatek: Correct operator & -> && Jian Dong
2021-03-16 11:35 ` Avri Altman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.