Skip to contentSkip to conversation

scsi: ufs-mediatek: Correct operator & -> &&

PATCH Superseded Jian Dong 2 participants 2 messages Mar 12, 2021 – Mar 16, 2021 SCSI

lore
Share & tools
lore

Jian Dong

author
#0 lore raw

PATCH 1/1 scsi: ufs-mediatek: Correct operator & -> &&

From: dongjian <[email protected]>

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

---
 drivers/scsi/ufs/ufs-mediatek.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ufs/ufs-mediatek.c +1 -1
index c55202b..a981f26 100644
@@ -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)
Signature · 1 line
1.9.1
#1 lore raw
Quoted 5 lines

From: dongjian <[email protected]>

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

Quoted 23 lines
---
 drivers/scsi/ufs/ufs-mediatek.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ufs/ufs-mediatek.c +1 -1
index c55202b..a981f26 100644
@@ -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