]> git.karo-electronics.de Git - linux-beck.git/commit
mac80211: minstrel_ht: use group flags instead of index to display rates
authorKarl Beldan <karl.beldan@rivierawaves.com>
Wed, 22 Oct 2014 16:20:37 +0000 (18:20 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 23 Oct 2014 18:36:13 +0000 (20:36 +0200)
commit8ec7886b1cd59c6e76a6d8fa413f9d338cfedc96
tree8d0e02477ec4079f0ce373dd3e44e31366fe1d89
parent4619194a49bfbbb03d20d4ca45c3eb1dc8297d9d
mac80211: minstrel_ht: use group flags instead of index to display rates

When displaying a rate through debugfs minstrel_ht guesses its flags
comparing group indexes.  Since 3ec373c421b6 ("mac80211: minstrel_ht:
include type (cck/ht) in rates flag"), the rate flags of interest are
present in the mcs_group-s, so use it.
While improving the code, this also fixes a smatch false positive
"error: testing array offset 'i' after use" in minstrel_ht_stats_dump.
This warning only triggers after 9208247d74bc ("mac80211: minstrel_ht:
add basic support for VHT rates <= 3SS@80MHz") with
CONFIG_MAC80211_RC_MINSTREL_VHT unset because then MINSTREL_VHT_GROUP_0
is above MINSTREL_GROUPS_NB and smatch only barks when the "testing
array offset" seems to prevent possible out of bonds accesses (which
does not happen here since i < ARRAY_SIZE(mi->groups)).

Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/rc80211_minstrel_ht_debugfs.c