From patchwork Wed Jul 11 12:47:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 942479 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-rtc-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arndb.de Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41Qf3z2k02zB4MN for ; Wed, 11 Jul 2018 22:47:43 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732488AbeGKMvw (ORCPT ); Wed, 11 Jul 2018 08:51:52 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:46405 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726457AbeGKMvw (ORCPT ); Wed, 11 Jul 2018 08:51:52 -0400 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0LxLzO-1gAW863Lqc-016tLb; Wed, 11 Jul 2018 14:47:24 +0200 From: Arnd Bergmann To: Alessandro Zummo , Alexandre Belloni Cc: y2038@lists.linaro.org, Arnd Bergmann , Jason Gunthorpe , John Stultz , Baolin Wang , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [RESEND] rtc: use ktime_get_real_ts64() instead of getnstimeofday64() Date: Wed, 11 Jul 2018 14:47:12 +0200 Message-Id: <20180711124723.1114803-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:sIg3VFIe/kxFS7TzZf0XZAAdA6o3MkTkVBLkgVKw9hbAqM+p5/s g9ncHOwPQv14GsRhsb0jAfD1KOYoT+uewvs6oYTIuPvtE+QxddPxQ0pdRcjjtKocZDV8v8V k93sAiu2p9AD7ehZjEg/hCow/gyb+mYS8deE9KjCMz2xsnDmqkCXhB0qUqCxQLOSKadfA1q Mk5qN3KyWqSpoFxDVRDGw== X-UI-Out-Filterresults: notjunk:1; V01:K0:989l6+6AYpw=:h9ioO5utxpWXAvOCZt9Bvz soVqRJsQ+EAx2MZYK0bPVqCVjTfOeawBVbvjA53yPgr2wMGKbclC1zuZxH39mCGwXGwv+/FJq P0GiQO6+FvT38WTECe45uUoYuf695kO77epPg3ziXKlOT2QxDnU/MbZW0dT3FBLAtbcLUruHb QhIwhVg65F8/VgyIAtIMHCp2GEyXZCwAy+rytgiea+fSH4uHYtXIm//iuWq1StHopi5pQdmTn MHiTGJlwF5WVuHCUZ/gpzocW5jRzHNgO9+vswaNxuMpurIkenlaUfBMhQMYGl6CwMlY5TNaGy aI2aU2Du7YCDiwGeuZ03KbwEw4iJRii/ikfJGcdUyE7aK5IE1ve9q/3aQlEjZ0lTHMYLih+kd 5wyYwMa+Hd1iyPHYcvru++avTqE3z3sc3u9glv5PUNUkmWvFi6JWlu1Ttkea0j6/5dZPqU5Fb LCen4zTokNze8lajhc+i12FrBHqKu5OP8rnG4IkczcZ4VqbO4L8MGOOAPkh1d0BSNuc0u61LR AC45ycDmnj69tbaqQeMu4iNxIXbEg8/Fbd0y19ooruGWUMqodwcWN8X/5KSKJ5jkhgvwFZThF 2S4vBA6N+ut7resYuZA2dnVAyOtuNwDMR25tD5T7VMSwIDWeklywT2VjefGuN3CtI5PqgZfpp Ot6V9eA90sosndLOwzbg04edpJDlh7q2ztxxetmv2XVCYluG7XArrWm4wr7gosqd1DWA= Sender: linux-rtc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org 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 --- Originally sent on Jun 18, but got no reply Alexandre, could you pick this up into the rtc tree? --- 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));