Re: + timekeeping-use-time_is_before_jiffies-instead-of-open-coding-it.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 22 2022 at 13:37, Andrew Morton wrote:
> From: Wang Qing <wangqing@xxxxxxxx>
> 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@xxxxxxxx
> Signed-off-by: Wang Qing <wangqing@xxxxxxxx>
> Cc: John Stultz <john.stultz@xxxxxxxxxx>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Stephen Boyd <sboyd@xxxxxxxxxx>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> ---
>
>  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





[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux