summaryrefslogtreecommitdiff
path: root/net/mac80211/rc80211_minstrel_ht_debugfs.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2021-01-27 06:57:30 +0100
committerJohannes Berg <johannes.berg@intel.com>2021-02-12 08:56:28 +0100
commita42fa256f66c425021038f40d9255d377a2d1a8d (patch)
treeda11b5497aaab95c653202b0fb066a1644351cdf /net/mac80211/rc80211_minstrel_ht_debugfs.c
parent9e6d51265b0aba145ab03b30dcdf3b88902e71f0 (diff)
mac80211: minstrel_ht: use bitfields to encode rate indexes
Get rid of a lot of divisions and modulo operations Reduces code size and improves performance Signed-off-by: Felix Fietkau <nbd@nbd.name> Link: https://lore.kernel.org/r/20210127055735.78599-1-nbd@nbd.name Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rc80211_minstrel_ht_debugfs.c')
-rw-r--r--net/mac80211/rc80211_minstrel_ht_debugfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mac80211/rc80211_minstrel_ht_debugfs.c b/net/mac80211/rc80211_minstrel_ht_debugfs.c
index 3b7af242cde6..067d10383fa7 100644
--- a/net/mac80211/rc80211_minstrel_ht_debugfs.c
+++ b/net/mac80211/rc80211_minstrel_ht_debugfs.c
@@ -56,7 +56,7 @@ minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p)
for (j = 0; j < MCS_GROUP_RATES; j++) {
struct minstrel_rate_stats *mrs = &mi->groups[i].rates[j];
- int idx = i * MCS_GROUP_RATES + j;
+ int idx = MI_RATE(i, j);
unsigned int duration;
if (!(mi->supported[i] & BIT(j)))
@@ -201,7 +201,7 @@ minstrel_ht_stats_csv_dump(struct minstrel_ht_sta *mi, int i, char *p)
for (j = 0; j < MCS_GROUP_RATES; j++) {
struct minstrel_rate_stats *mrs = &mi->groups[i].rates[j];
- int idx = i * MCS_GROUP_RATES + j;
+ int idx = MI_RATE(i, j);
unsigned int duration;
if (!(mi->supported[i] & BIT(j)))