diff options
author | Wang Qing <wangqing@vivo.com> | 2022-02-27 19:14:20 -0800 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2022-03-10 18:17:10 +0200 |
commit | 8cbc3d51b4ae5a2875422af9a955f29f73b1fe75 (patch) | |
tree | 0424abe70611debb7ab00cf2003c5e0117ce5249 /drivers/net/wireless/st | |
parent | 56e4e4538ef0c4f80c4b015b82c4778e3ace55cb (diff) |
cw1200: use time_is_after_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.
Signed-off-by: Wang Qing <wangqing@vivo.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/1646018060-61275-1-git-send-email-wangqing@vivo.com
Diffstat (limited to 'drivers/net/wireless/st')
-rw-r--r-- | drivers/net/wireless/st/cw1200/queue.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/st/cw1200/queue.c b/drivers/net/wireless/st/cw1200/queue.c index 12952b1c29df..e06da4b3b0d4 100644 --- a/drivers/net/wireless/st/cw1200/queue.c +++ b/drivers/net/wireless/st/cw1200/queue.c @@ -8,6 +8,7 @@ #include <net/mac80211.h> #include <linux/sched.h> +#include <linux/jiffies.h> #include "queue.h" #include "cw1200.h" #include "debug.h" @@ -94,7 +95,7 @@ static void __cw1200_queue_gc(struct cw1200_queue *queue, bool wakeup_stats = false; list_for_each_entry_safe(item, tmp, &queue->queue, head) { - if (jiffies - item->queue_timestamp < queue->ttl) + if (time_is_after_jiffies(item->queue_timestamp + queue->ttl)) break; --queue->num_queued; --queue->link_map_cache[item->txpriv.link_id]; |