[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <9a33455c19ef6ec0427b45b2e7f7053cf7353fe8.1569055057.git.lorenzo@kernel.org>
Date: Sat, 21 Sep 2019 10:44:01 +0200
From: Lorenzo Bianconi <lorenzo@...nel.org>
To: kvalo@...eaurora.org
Cc: lorenzo.bianconi@...hat.com, linux-wireless@...r.kernel.org,
netdev@...r.kernel.org, kubakici@...pl
Subject: [PATCH] mt7601u: fix bbp version check in mt7601u_wait_bbp_ready
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@...pl>
Signed-off-by: Lorenzo Bianconi <lorenzo@...nel.org>
---
drivers/net/wireless/mediatek/mt7601u/phy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
--
2.21.0
Powered by blists - more mailing lists