]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mt7601u: fix bbp version check in mt7601u_wait_bbp_ready
authorLorenzo Bianconi <lorenzo@kernel.org>
Sat, 21 Sep 2019 08:44:01 +0000 (10:44 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 1 Oct 2019 09:19:20 +0000 (12:19 +0300)
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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mediatek/mt7601u/phy.c

index 06f5702ab4bd096c5ac755d06cdd7db1efbc3632..d863ab4a66c968d7ef1acc0c0c406ad01e100e12 100644 (file)
@@ -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);