[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1646018139-61508-1-git-send-email-wangqing@vivo.com>
Date: Sun, 27 Feb 2022 19:15:39 -0800
From: Qing Wang <wangqing@...o.com>
To: John Stultz <john.stultz@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Stephen Boyd <sboyd@...nel.org>, linux-kernel@...r.kernel.org
Cc: Wang Qing <wangqing@...o.com>
Subject: [PATCH] timekeeping: use time_is_before_jiffies() instead of open coding it
From: Wang Qing <wangqing@...o.com>
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.
Signed-off-by: Wang Qing <wangqing@...o.com>
---
kernel/time/timekeeping.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index dcdcb85..6f32ac6
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -215,7 +215,7 @@ static void timekeeping_check_update(struct timekeeper *tk, u64 offset)
}
if (tk->underflow_seen) {
- if (jiffies - tk->last_warning > WARNING_FREQ) {
+ if (time_is_before_jiffies(tk->last_warning + WARNING_FREQ)) {
printk_deferred("WARNING: Underflow in clocksource '%s' observed, time update ignored.\n", name);
printk_deferred(" Please report this, consider using a different clocksource, if possible.\n");
printk_deferred(" Your kernel is probably still fine.\n");
@@ -225,7 +225,7 @@ static void timekeeping_check_update(struct timekeeper *tk, u64 offset)
}
if (tk->overflow_seen) {
- if (jiffies - tk->last_warning > WARNING_FREQ) {
+ if (time_is_before_jiffies(tk->last_warning + WARNING_FREQ)) {
printk_deferred("WARNING: Overflow in clocksource '%s' observed, time update capped.\n", name);
printk_deferred(" Please report this, consider using a different clocksource, if possible.\n");
printk_deferred(" Your kernel is probably still fine.\n");
--
2.7.4
Powered by blists - more mailing lists