1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 14 Dec 2016 20:12:25 +0100
3 Subject: [PATCH] mac80211: check for MCS in ieee80211_duration before fetching
6 Makes the code a bit more efficient
8 Signed-off-by: Felix Fietkau <nbd@nbd.name>
11 --- a/net/mac80211/tx.c
12 +++ b/net/mac80211/tx.c
13 @@ -63,6 +63,10 @@ static __le16 ieee80211_duration(struct
14 struct ieee80211_chanctx_conf *chanctx_conf;
17 + /* assume HW handles this */
18 + if (tx->rate.flags & (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS))
22 chanctx_conf = rcu_dereference(tx->sdata->vif.chanctx_conf);
24 @@ -71,10 +75,6 @@ static __le16 ieee80211_duration(struct
28 - /* assume HW handles this */
29 - if (tx->rate.flags & (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS))
33 if (WARN_ON_ONCE(tx->rate.idx < 0))