lkml.org 
[lkml]   [2020]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.9 003/271] mt7601u: fix bbp version check in mt7601u_wait_bbp_ready
    Date
    From: Lorenzo Bianconi <lorenzo@kernel.org>

    commit 15e14f76f85f4f0eab3b8146e1cd3c58ce272823 upstream.

    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>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/net/wireless/mediatek/mt7601u/phy.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/net/wireless/mediatek/mt7601u/phy.c
    +++ b/drivers/net/wireless/mediatek/mt7601u/phy.c
    @@ -221,7 +221,7 @@ int mt7601u_wait_bbp_ready(struct mt7601

    do {
    val = mt7601u_bbp_rr(dev, MT_BBP_REG_VERSION);
    - if (val && ~val)
    + if (val && val != 0xff)
    break;
    } while (--i);


    \
     
     \ /
      Last update: 2020-01-28 15:41    [W:4.082 / U:0.080 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site