* + timekeeping-use-time_is_before_jiffies-instead-of-open-coding-it.patch added to -mm tree
@ 2022-04-22 20:37 Andrew Morton
2022-04-25 12:39 ` Thomas Gleixner
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Morton @ 2022-04-22 20:37 UTC (permalink / raw)
To: mm-commits, tglx, sboyd, john.stultz, wangqing, akpm
The patch titled
Subject: timekeeping: use time_is_before_jiffies() instead of open coding it
has been added to the -mm tree. Its filename is
timekeeping-use-time_is_before_jiffies-instead-of-open-coding-it.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/timekeeping-use-time_is_before_jiffies-instead-of-open-coding-it.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/timekeeping-use-time_is_before_jiffies-instead-of-open-coding-it.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Wang Qing <wangqing@vivo.com>
Subject: timekeeping: use time_is_before_jiffies() instead of open coding it
Use the helper function time_is_{before,after}_jiffies() to improve code
readability.
Link: https://lkml.kernel.org/r/1650621172-66967-10-git-send-email-wangqing@vivo.com
Signed-off-by: Wang Qing <wangqing@vivo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
kernel/time/timekeeping.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/kernel/time/timekeeping.c~timekeeping-use-time_is_before_jiffies-instead-of-open-coding-it
+++ a/kernel/time/timekeeping.c
@@ -216,7 +216,7 @@ static void timekeeping_check_update(str
}
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");
@@ -226,7 +226,7 @@ static void timekeeping_check_update(str
}
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");
_
Patches currently in -mm which might be from wangqing@vivo.com are
block-xen-use-time_is_before_eq_jiffies-instead-of-open-coding-it.patch
gpu-drm-i915-use-time_is_after_jiffies-instead-of-open-coding-it.patch
gpu-drm-radeon-use-time_is_before_jiffies-instead-of-open-coding-it.patch
hid-use-time_is_after_jiffies-instead-of-open-coding-it.patch
md-use-time_is_before_eq_jiffies-instead-of-open-coding-it.patch
net-wireless-marvell-use-time_is_before_jiffies-instead-of-open-coding-it.patch
scsi-bfa-use-time_is_before_jiffies-instead-of-open-coding-it.patch
timekeeping-use-time_is_before_jiffies-instead-of-open-coding-it.patch
net-decnet-use-time_is_before_jiffies-instead-of-open-coding-it.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: + timekeeping-use-time_is_before_jiffies-instead-of-open-coding-it.patch added to -mm tree
2022-04-22 20:37 + timekeeping-use-time_is_before_jiffies-instead-of-open-coding-it.patch added to -mm tree Andrew Morton
@ 2022-04-25 12:39 ` Thomas Gleixner
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2022-04-25 12:39 UTC (permalink / raw)
To: Andrew Morton, mm-commits, sboyd, john.stultz, wangqing, akpm
On Fri, Apr 22 2022 at 13:37, Andrew Morton wrote:
> From: Wang Qing <wangqing@vivo.com>
> Subject: timekeeping: use time_is_before_jiffies() instead of open coding it
>
> Use the helper function time_is_{before,after}_jiffies() to improve code
> readability.
>
> Link: https://lkml.kernel.org/r/1650621172-66967-10-git-send-email-wangqing@vivo.com
> Signed-off-by: Wang Qing <wangqing@vivo.com>
> Cc: John Stultz <john.stultz@linaro.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> kernel/time/timekeeping.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- a/kernel/time/timekeeping.c~timekeeping-use-time_is_before_jiffies-instead-of-open-coding-it
> +++ a/kernel/time/timekeeping.c
> @@ -216,7 +216,7 @@ static void timekeeping_check_update(str
> }
>
> if (tk->underflow_seen) {
> - if (jiffies - tk->last_warning > WARNING_FREQ) {
> + if (time_is_before_jiffies(tk->last_warning + WARNING_FREQ)) {
I have a hard time to see how this improves anything. The least thing it
improves is readability.
Yeah, I know some script told so....
Thanks,
tglx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-25 12:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-22 20:37 + timekeeping-use-time_is_before_jiffies-instead-of-open-coding-it.patch added to -mm tree Andrew Morton
2022-04-25 12:39 ` Thomas Gleixner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.