Search Linux Wireless

[bug report] mt76: add mac80211 driver for MT7915 PCIe-based chipsets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux