555-ath9k-dynack-check-da-enabled-first-in-sampling-rout.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. From: Lorenzo Bianconi <[email protected]>
  2. Date: Fri, 2 Nov 2018 21:49:57 +0100
  3. Subject: [PATCH] ath9k: dynack: check da->enabled first in sampling
  4. routines
  5. Check da->enabled flag first in ath_dynack_sample_tx_ts and
  6. ath_dynack_sample_ack_ts routines in order to avoid useless
  7. processing
  8. Tested-by: Koen Vandeputte <[email protected]>
  9. Signed-off-by: Lorenzo Bianconi <[email protected]>
  10. ---
  11. --- a/drivers/net/wireless/ath/ath9k/dynack.c
  12. +++ b/drivers/net/wireless/ath/ath9k/dynack.c
  13. @@ -178,7 +178,7 @@ void ath_dynack_sample_tx_ts(struct ath_
  14. u32 dur = ts->duration;
  15. u8 ridx;
  16. - if ((info->flags & IEEE80211_TX_CTL_NO_ACK) || !da->enabled)
  17. + if (!da->enabled || (info->flags & IEEE80211_TX_CTL_NO_ACK))
  18. return;
  19. spin_lock_bh(&da->qlock);
  20. @@ -251,7 +251,7 @@ void ath_dynack_sample_ack_ts(struct ath
  21. struct ath_common *common = ath9k_hw_common(ah);
  22. struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
  23. - if (!ath_dynack_bssidmask(ah, hdr->addr1) || !da->enabled)
  24. + if (!da->enabled || !ath_dynack_bssidmask(ah, hdr->addr1))
  25. return;
  26. spin_lock_bh(&da->qlock);