From: Dan Carpenter <dan.carpenter@oracle.com>
To: ryder.lee@mediatek.com
Cc: Ryder Lee <ryder.lee@mediatek.com>,
linux-wireless@vger.kernel.org,
linux-mediatek@lists.infradead.org
Subject: [bug report] mt76: add mac80211 driver for MT7915 PCIe-based chipsets
Date: Wed, 20 May 2020 15:02:16 +0300 [thread overview]
Message-ID: <20200520120216.GC172354@mwanda> (raw)
Hello Ryder Lee,
The patch e57b7901469f: "mt76: add mac80211 driver for MT7915
PCIe-based chipsets" from Apr 25, 2020, leads to the following static
checker warning:
drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1303 mt7915_mac_sta_stats_work()
warn: test_bit() takes a bit number
drivers/net/wireless/mediatek/mt76/mt7915/mac.c
1299
1300 stats->jiffies = jiffies;
1301 }
1302
1303 if (test_and_clear_bit(IEEE80211_RC_SUPP_RATES_CHANGED |
1304 IEEE80211_RC_NSS_CHANGED |
1305 IEEE80211_RC_BW_CHANGED, &stats->changed))
^^^^^^^^^^^^^^^^^^^^^^^
These are like BIT(0), BIT(1) but the test_and_clear_bit() argument is
supposed to be 0, 1 etc... It's a double left shift to say BIT(BIT(1)).
1306 mt7915_mcu_add_rate_ctrl(dev, vif, sta);
1307
1308 if (test_and_clear_bit(IEEE80211_RC_SMPS_CHANGED, &stats->changed))
^^^^^^^^^^^^^^^^^^^^^^^^^
I'm not sure why these didn't generate a warning... :/ Probably a
life lesson there that you should never rely on software to work as
expected.
1309 mt7915_mcu_add_smps(dev, vif, sta);
1310
1311 spin_lock_bh(&dev->sta_poll_lock);
1312 if (list_empty(&msta->poll_list))
1313 list_add_tail(&msta->poll_list, &dev->sta_poll_list);
1314 spin_unlock_bh(&dev->sta_poll_lock);
regards,
dan carpenter
next reply other threads:[~2020-05-20 12:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 12:02 Dan Carpenter [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-05-20 12:08 [bug report] mt76: add mac80211 driver for MT7915 PCIe-based chipsets Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200520120216.GC172354@mwanda \
--to=dan.carpenter@oracle.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=ryder.lee@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).