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