diff options
author | Wang Qing <wangqing@vivo.com> | 2022-02-28 04:15:03 +0100 |
---|---|---|
committer | Boris Ostrovsky <boris.ostrovsky@oracle.com> | 2022-03-10 16:27:55 +0100 |
commit | b537bf429a682131f94df166e6daf39ec48fac03 (patch) | |
tree | 95d3017b582c123e26616396963fff134987de68 /drivers/xen/balloon.c | |
parent | Merge tag 'spi-fix-v5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff) | |
download | linux-b537bf429a682131f94df166e6daf39ec48fac03.tar.xz linux-b537bf429a682131f94df166e6daf39ec48fac03.zip |
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/balloon.c')
-rw-r--r-- | drivers/xen/balloon.c | 3 |
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"); } |