[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <309c7219-0154-272a-d535-6421e71f6ce5@codeaurora.org>
Date: Mon, 8 Apr 2019 11:47:15 +0530
From: Mukesh Ojha <mojha@...eaurora.org>
To: Andrei Vagin <avagin@...il.com>,
Thomas Gleixner <tglx@...utronix.de>
Cc: linux-kernel@...r.kernel.org, Stephen Boyd <sboyd@...nel.org>,
John Stultz <john.stultz@...aro.org>
Subject: Re: [PATCH] alarmtimer: return correct remaining time
On 4/8/2019 9:45 AM, Andrei Vagin wrote:
> To calculate a remaining time, we need to subtract the current time from
> the expiration time. Currently, arguments of ktime_sub are swapped.
>
> Signed-off-by: Andrei Vagin <avagin@...il.com>
> ---
> kernel/time/alarmtimer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
> index 2c97e8c2d29f..0519a8805aab 100644
> --- a/kernel/time/alarmtimer.c
> +++ b/kernel/time/alarmtimer.c
> @@ -594,7 +594,7 @@ static ktime_t alarm_timer_remaining(struct k_itimer *timr, ktime_t now)
> {
> struct alarm *alarm = &timr->it.alarm.alarmtimer;
>
> - return ktime_sub(now, alarm->node.expires);
> + return ktime_sub(alarm->node.expires, now);
Looks good to me.
Reviewed-by: Mukesh Ojha <mojha@...eaurora.org>
Cheers,
-Mukesh
> }
>
> /**
Powered by blists - more mailing lists