]> git.baikalelectronics.ru Git - kernel.git/commitdiff
wifi: mwl8k: use time_after to replace "jiffies > a"
authorLi Qiong <liqiong@nfschina.com>
Mon, 6 Jun 2022 13:54:49 +0000 (21:54 +0800)
committerKalle Valo <kvalo@kernel.org>
Wed, 27 Jul 2022 10:58:10 +0000 (13:58 +0300)
time_after deals with timer wrapping correctly.

Signed-off-by: Li Qiong <liqiong@nfschina.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220606135449.23256-1-liqiong@nfschina.com
Link: https://lore.kernel.org/r/20220618131305.13101-1-wangxiang@cdjrlc.com
Link: https://lore.kernel.org/r/20220715050016.24164-1-wangborong@cdjrlc.com
drivers/net/wireless/marvell/mwl8k.c

index c1bf8998109ccdd42e06bb00ec95dde0f4b5cf9f..4dc7e2e53b81e142cfbc1f6017aa46b59be69d3d 100644 (file)
@@ -1880,7 +1880,7 @@ static inline void mwl8k_tx_count_packet(struct ieee80211_sta *sta, u8 tid)
         * packets ever exceeds the ampdu_min_traffic threshold, we will allow
         * an ampdu stream to be started.
         */
-       if (jiffies - tx_stats->start_time > HZ) {
+       if (time_after(jiffies, (unsigned long)tx_stats->start_time + HZ)) {
                tx_stats->pkts = 0;
                tx_stats->start_time = 0;
        } else