[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1644890154-64915-2-git-send-email-wangqing@vivo.com>
Date: Mon, 14 Feb 2022 17:55:38 -0800
From: Qing Wang <wangqing@...o.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Roger Pau Monné <roger.pau@...rix.com>,
Jens Axboe <axboe@...nel.dk>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
"Pan, Xinhui" <Xinhui.Pan@....com>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Jiri Kosina <jikos@...nel.org>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Alasdair Kergon <agk@...hat.com>,
Mike Snitzer <snitzer@...hat.com>, dm-devel@...hat.com,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Hans Verkuil <hverkuil@...all.nl>,
xen-devel@...ts.xenproject.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-clk@...r.kernel.org,
intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
amd-gfx@...ts.freedesktop.org, linux-input@...r.kernel.org,
linux-media@...r.kernel.org
Cc: Wang Qing <wangqing@...o.com>
Subject: [PATCH V3 1/13] block: xen: use time_is_before_eq_jiffies() instead of open coding it
From: Wang Qing <wangqing@...o.com>
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.
Signed-off-by: Wang Qing <wangqing@...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 d1e2646..aecc1f4
--- 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_is_before_eq_jiffies(
+ persistent_gnt->last_used + HZ * pgrant_timeout);
}
#define vaddr(page) ((unsigned long)pfn_to_kaddr(page_to_pfn(page)))
--
2.7.4
Powered by blists - more mailing lists