diff mbox series

mt7601u: fix bbp version check in mt7601u_wait_bbp_ready

Message ID 9a33455c19ef6ec0427b45b2e7f7053cf7353fe8.1569055057.git.lorenzo@kernel.org (mailing list archive)
State Accepted
Commit 15e14f76f85f4f0eab3b8146e1cd3c58ce272823
Delegated to: Kalle Valo
Headers show
Series mt7601u: fix bbp version check in mt7601u_wait_bbp_ready | expand

Commit Message

Lorenzo Bianconi Sept. 21, 2019, 8:44 a.m. UTC
Fix bbp ready check in mt7601u_wait_bbp_ready. The issue is reported by
coverity with the following error:

Logical vs. bitwise operator
The expression's value does not depend on the operands; inadvertent use
of the wrong operator is a likely logic error.

Addresses-Coverity-ID: 1309441 ("Logical vs. bitwise operator")
Fixes: c869f77d6abb ("add mt7601u driver")
Acked-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/wireless/mediatek/mt7601u/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo Oct. 1, 2019, 9:19 a.m. UTC | #1
Lorenzo Bianconi <lorenzo@kernel.org> wrote:

> Fix bbp ready check in mt7601u_wait_bbp_ready. The issue is reported by
> coverity with the following error:
> 
> Logical vs. bitwise operator
> The expression's value does not depend on the operands; inadvertent use
> of the wrong operator is a likely logic error.
> 
> Addresses-Coverity-ID: 1309441 ("Logical vs. bitwise operator")
> Fixes: c869f77d6abb ("add mt7601u driver")
> Acked-by: Jakub Kicinski <kubakici@wp.pl>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

Patch applied to wireless-drivers-next.git, thanks.

15e14f76f85f mt7601u: fix bbp version check in mt7601u_wait_bbp_ready
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt7601u/phy.c b/drivers/net/wireless/mediatek/mt7601u/phy.c
index 06f5702ab4bd..d863ab4a66c9 100644
--- a/drivers/net/wireless/mediatek/mt7601u/phy.c
+++ b/drivers/net/wireless/mediatek/mt7601u/phy.c
@@ -213,7 +213,7 @@  int mt7601u_wait_bbp_ready(struct mt7601u_dev *dev)
 
 	do {
 		val = mt7601u_bbp_rr(dev, MT_BBP_REG_VERSION);
-		if (val && ~val)
+		if (val && val != 0xff)
 			break;
 	} while (--i);