[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230706091613.40136-1-zhangzehao@vivo.com>
Date: Thu, 6 Jul 2023 17:16:13 +0800
From: Zehao Zhang <zhangzehao@...o.com>
To: roger.pau@...rix.com, axboe@...nel.dk
Cc: xen-devel@...ts.xenproject.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, Zehao Zhang <zhangzehao@...o.com>
Subject: [PATCH] xen/blkback: Convert to use time_after_eq macro
Use time_after_eq macro instead of opening it for readability.
Signed-off-by: Zehao Zhang <zhangzehao@...o.com>
---
drivers/block/xen-blkback/blkback.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index c362f4ad80ab..77b1b1785eb3 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -42,6 +42,7 @@
#include <linux/delay.h>
#include <linux/freezer.h>
#include <linux/bitmap.h>
+#include <linux/jiffies.h>
#include <xen/events.h>
#include <xen/page.h>
@@ -134,8 +135,8 @@ module_param(log_stats, int, 0644);
static inline bool persistent_gnt_timeout(struct persistent_gnt *persistent_gnt)
{
- return pgrant_timeout && (jiffies - persistent_gnt->last_used >=
- HZ * pgrant_timeout);
+ return pgrant_timeout && (time_after_eq(jiffies,
+ persistent_gnt->last_used + HZ * pgrant_timeout));
}
#define vaddr(page) ((unsigned long)pfn_to_kaddr(page_to_pfn(page)))
--
2.35.3
Powered by blists - more mailing lists