public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	y2038@lists.linaro.org, Jason Gunthorpe <jgg@ziepe.ca>,
	John Stultz <john.stultz@linaro.org>,
	Baolin Wang <baolin.wang@linaro.org>,
	linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [RESEND] rtc: use ktime_get_real_ts64() instead of getnstimeofday64()
Date: Fri, 13 Jul 2018 10:49:02 +0200	[thread overview]
Message-ID: <20180713084902.GO16084@piout.net> (raw)
In-Reply-To: <20180711124723.1114803-1-arnd@arndb.de>

On 11/07/2018 14:47:12+0200, Arnd Bergmann wrote:
> getnstimeofday64() is just a wrapper around the ktime accessor, so
> we should use that directly.
> 
> I considered using ktime_get_boottime_ts64() (to avoid leap second
> problems) or ktime_get_real_seconds() (to simplify the calculation,
> but in the end concluded that the existing interface is probably
> the most appropriate in this case.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> Originally sent on Jun 18, but got no reply
> 
> Alexandre, could you pick this up into the rtc tree?

Yes, I've been late in my reviews lately. It is applied now.

I had some trouble figuring out that ktime_get_real_ts64 was not a macro
anymore as I was still looking at 4.17 ;)

> ---
>  drivers/rtc/class.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
> index d37588f08055..7fa32c922617 100644
> --- a/drivers/rtc/class.c
> +++ b/drivers/rtc/class.c
> @@ -68,7 +68,7 @@ static int rtc_suspend(struct device *dev)
>  		return 0;
>  	}
>  
> -	getnstimeofday64(&old_system);
> +	ktime_get_real_ts64(&old_system);
>  	old_rtc.tv_sec = rtc_tm_to_time64(&tm);
>  
>  
> @@ -110,7 +110,7 @@ static int rtc_resume(struct device *dev)
>  		return 0;
>  
>  	/* snapshot the current rtc and system time at resume */
> -	getnstimeofday64(&new_system);
> +	ktime_get_real_ts64(&new_system);
>  	err = rtc_read_time(rtc, &tm);
>  	if (err < 0) {
>  		pr_debug("%s:  fail to read rtc time\n", dev_name(&rtc->dev));
> -- 
> 2.9.0
> 

-- 
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

      reply	other threads:[~2018-07-13  8:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11 12:47 [PATCH] [RESEND] rtc: use ktime_get_real_ts64() instead of getnstimeofday64() Arnd Bergmann
2018-07-13  8:49 ` Alexandre Belloni [this message]

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=20180713084902.GO16084@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=arnd@arndb.de \
    --cc=baolin.wang@linaro.org \
    --cc=jgg@ziepe.ca \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=y2038@lists.linaro.org \
    /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