diff options
| author | Wang Qing <[email protected]> | 2022-02-28 03:15:03 +0000 |
|---|---|---|
| committer | Boris Ostrovsky <[email protected]> | 2022-03-10 15:27:55 +0000 |
| commit | b537bf429a682131f94df166e6daf39ec48fac03 (patch) | |
| tree | 95d3017b582c123e26616396963fff134987de68 | |
| parent | Merge tag 'spi-fix-v5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff) | |
| download | kernel-b537bf429a682131f94df166e6daf39ec48fac03.tar.gz kernel-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 <[email protected]>
Reviewed-by: Boris Ostrovsky <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Boris Ostrovsky <[email protected]>
| -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"); } |
