linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen: use time_is_before_eq_jiffies() instead of open coding it
@ 2022-02-28  3:15 Qing Wang
  2022-03-11 14:18 ` Boris Ostrovsky
  0 siblings, 1 reply; 2+ messages in thread
From: Qing Wang @ 2022-02-28  3:15 UTC (permalink / raw)
  To: Boris Ostrovsky, Juergen Gross, Stefano Stabellini, xen-devel,
	linux-kernel
  Cc: Wang Qing

From: Wang Qing <wangqing@vivo.com>

Use the helper function time_is_{before,after}_jiffies() to improve
code readability.

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/xen/balloon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index a2c4fc49..dfe26fa
--- 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");
 		}
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xen: use time_is_before_eq_jiffies() instead of open coding it
  2022-02-28  3:15 [PATCH] xen: use time_is_before_eq_jiffies() instead of open coding it Qing Wang
@ 2022-03-11 14:18 ` Boris Ostrovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Boris Ostrovsky @ 2022-03-11 14:18 UTC (permalink / raw)
  To: Qing Wang, Juergen Gross, Stefano Stabellini, xen-devel, linux-kernel


On 2/27/22 10:15 PM, Qing Wang wrote:
> From: Wang Qing <wangqing@vivo.com>
>
> 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>


Applied to for-linus-5.18


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-11 14:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28  3:15 [PATCH] xen: use time_is_before_eq_jiffies() instead of open coding it Qing Wang
2022-03-11 14:18 ` Boris Ostrovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).