diff mbox series

[2/2] mwl8k: use time_after to replace "jiffies > a"

Message ID 20220606135449.23256-1-liqiong@nfschina.com (mailing list archive)
State Accepted
Commit 8006bb53ca0fb95d42ff0e8088a84ad8e0da8069
Delegated to: Kalle Valo
Headers show
Series None | expand

Commit Message

Li Qiong June 6, 2022, 1:54 p.m. UTC
time_after deals with timer wrapping correctly.

Signed-off-by: Li Qiong <liqiong@nfschina.com>
---
 drivers/net/wireless/marvell/mwl8k.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo July 27, 2022, 10:57 a.m. UTC | #1
Li Qiong <liqiong@nfschina.com> wrote:

> time_after deals with timer wrapping correctly.
> 
> Signed-off-by: Li Qiong <liqiong@nfschina.com>

Patch applied to wireless-next.git, thanks.

8006bb53ca0f wifi: mwl8k: use time_after to replace "jiffies > a"
diff mbox series

Patch

diff --git a/drivers/net/wireless/marvell/mwl8k.c b/drivers/net/wireless/marvell/mwl8k.c
index 864a2ba9efee..2dfb8c10bb57 100644
--- a/drivers/net/wireless/marvell/mwl8k.c
+++ b/drivers/net/wireless/marvell/mwl8k.c
@@ -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