Commit a544ab7f9c09df591758931301a7c509bba6c913
1 parent
9caf036402
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
mac80211: simplify loop in minstrel_ht
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Showing 1 changed file with 3 additions and 5 deletions Side-by-side Diff
net/mac80211/rc80211_minstrel_ht.c
... | ... | @@ -389,9 +389,9 @@ |
389 | 389 | struct ieee80211_tx_rate *ar = info->status.rates; |
390 | 390 | struct minstrel_rate_stats *rate, *rate2; |
391 | 391 | struct minstrel_priv *mp = priv; |
392 | - bool last = false; | |
392 | + bool last; | |
393 | 393 | int group; |
394 | - int i = 0; | |
394 | + int i; | |
395 | 395 | |
396 | 396 | if (!msp->is_ht) |
397 | 397 | return mac80211_minstrel.tx_status(priv, sband, sta, &msp->legacy, skb); |
398 | 398 | |
... | ... | @@ -419,12 +419,10 @@ |
419 | 419 | if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) |
420 | 420 | mi->sample_packets += info->status.ampdu_len; |
421 | 421 | |
422 | + last = !minstrel_ht_txstat_valid(&ar[0]); | |
422 | 423 | for (i = 0; !last; i++) { |
423 | 424 | last = (i == IEEE80211_TX_MAX_RATES - 1) || |
424 | 425 | !minstrel_ht_txstat_valid(&ar[i + 1]); |
425 | - | |
426 | - if (!minstrel_ht_txstat_valid(&ar[i])) | |
427 | - break; | |
428 | 426 | |
429 | 427 | group = minstrel_ht_get_group_idx(&ar[i]); |
430 | 428 | rate = &mi->groups[group].rates[ar[i].idx % 8]; |