netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] mwl8k: use time_after to replace "jiffies > a"
@ 2022-06-06 13:54 Li Qiong
  2022-07-27 10:57 ` [2/2] wifi: " Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Li Qiong @ 2022-06-06 13:54 UTC (permalink / raw)
  To: Lennert Buytenhek, Kalle Valo, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Li Qiong
  Cc: linux-wireless, netdev, linux-kernel, yuzhe, renyu

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(-)

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
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [2/2] wifi: mwl8k: use time_after to replace "jiffies > a"
  2022-06-06 13:54 [PATCH 2/2] mwl8k: use time_after to replace "jiffies > a" Li Qiong
@ 2022-07-27 10:57 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2022-07-27 10:57 UTC (permalink / raw)
  To: Li Qiong
  Cc: Lennert Buytenhek, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Li Qiong, linux-wireless, netdev,
	linux-kernel, yuzhe, renyu

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"

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20220606135449.23256-1-liqiong@nfschina.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-27 10:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-06 13:54 [PATCH 2/2] mwl8k: use time_after to replace "jiffies > a" Li Qiong
2022-07-27 10:57 ` [2/2] wifi: " Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).