linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mukesh Ojha <mojha@codeaurora.org>
To: Andrei Vagin <avagin@gmail.com>, Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, Stephen Boyd <sboyd@kernel.org>,
	John Stultz <john.stultz@linaro.org>
Subject: Re: [PATCH] alarmtimer: return correct remaining time
Date: Mon, 8 Apr 2019 11:47:15 +0530	[thread overview]
Message-ID: <309c7219-0154-272a-d535-6421e71f6ce5@codeaurora.org> (raw)
In-Reply-To: <20190408041542.26338-1-avagin@gmail.com>


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@gmail.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@codeaurora.org>

Cheers,
-Mukesh

>   }
>   
>   /**

  reply	other threads:[~2019-04-08  6:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08  4:15 [PATCH] alarmtimer: return correct remaining time Andrei Vagin
2019-04-08  6:17 ` Mukesh Ojha [this message]
2019-04-10 13:28 ` [tip:timers/urgent] alarmtimer: Return " tip-bot for Andrei Vagin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=309c7219-0154-272a-d535-6421e71f6ce5@codeaurora.org \
    --to=mojha@codeaurora.org \
    --cc=avagin@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).