Skip to content

Commit b537bf4

Browse files
Wang Qingbostrovs
authored andcommitted
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 <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Boris Ostrovsky <[email protected]>
1 parent 1db333d commit b537bf4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/xen/balloon.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
#include <linux/slab.h>
6060
#include <linux/sysctl.h>
6161
#include <linux/moduleparam.h>
62+
#include <linux/jiffies.h>
6263

6364
#include <asm/page.h>
6465
#include <asm/tlb.h>
@@ -794,7 +795,7 @@ static int __init balloon_wait_finish(void)
794795
if (balloon_state == BP_ECANCELED) {
795796
pr_warn_once("Initial ballooning failed, %ld pages need to be freed.\n",
796797
-credit);
797-
if (jiffies - last_changed >= HZ * balloon_boot_timeout)
798+
if (time_is_before_eq_jiffies(last_changed + HZ * balloon_boot_timeout))
798799
panic("Initial ballooning failed!\n");
799800
}
800801

0 commit comments

Comments
 (0)