summaryrefslogtreecommitdiff
path: root/drivers/xen
diff options
context:
space:
mode:
authorWang Qing <wangqing@vivo.com>2022-02-27 19:15:03 -0800
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>2022-03-10 09:27:55 -0600
commitb537bf429a682131f94df166e6daf39ec48fac03 (patch)
tree95d3017b582c123e26616396963fff134987de68 /drivers/xen
parent1db333d9a51f3459fba1bcaa564d95befe79f0b3 (diff)
xen: use time_is_before_eq_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> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Link: https://lore.kernel.org/r/1646018104-61415-1-git-send-email-wangqing@vivo.com Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/balloon.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index a2c4fc49c483..dfe26fa17e95 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -59,6 +59,7 @@
#include <linux/slab.h>
#include <linux/sysctl.h>
#include <linux/moduleparam.h>
+#include <linux/jiffies.h>
#include <asm/page.h>
#include <asm/tlb.h>
@@ -794,7 +795,7 @@ static int __init balloon_wait_finish(void)
if (balloon_state == BP_ECANCELED) {
pr_warn_once("Initial ballooning failed, %ld pages need to be freed.\n",
-credit);
- if (jiffies - last_changed >= HZ * balloon_boot_timeout)
+ if (time_is_before_eq_jiffies(last_changed + HZ * balloon_boot_timeout))
panic("Initial ballooning failed!\n");
}