linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mt7601u: fix bbp version check in mt7601u_wait_bbp_ready
@ 2019-09-21  8:44 Lorenzo Bianconi
  2019-10-01  9:19 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Lorenzo Bianconi @ 2019-09-21  8:44 UTC (permalink / raw)
  To: kvalo; +Cc: lorenzo.bianconi, linux-wireless, netdev, kubakici

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

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


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

* Re: [PATCH] mt7601u: fix bbp version check in mt7601u_wait_bbp_ready
  2019-09-21  8:44 [PATCH] mt7601u: fix bbp version check in mt7601u_wait_bbp_ready Lorenzo Bianconi
@ 2019-10-01  9:19 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2019-10-01  9:19 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: lorenzo.bianconi, linux-wireless, netdev, kubakici

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

-- 
https://patchwork.kernel.org/patch/11155381/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2019-10-01  9:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-21  8:44 [PATCH] mt7601u: fix bbp version check in mt7601u_wait_bbp_ready Lorenzo Bianconi
2019-10-01  9:19 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).