From patchwork Mon Jun 18 14:22:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 138964 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4015085lji; Mon, 18 Jun 2018 07:22:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJqRf3GYkybrKZz9sz5n/55lSHI/eDi7F7A3Mu4s/7pCIDkgGQyETsDdM62HSlO2Qba3UGd X-Received: by 2002:a62:ecdb:: with SMTP id e88-v6mr13962457pfm.16.1529331775200; Mon, 18 Jun 2018 07:22:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529331775; cv=none; d=google.com; s=arc-20160816; b=Pkep/t0LaF4xVyHr46HEcFyHyJUsx87JJCLBRoGOY+C2ZxNMsLEtq89erhXx8DjWhJ /dCcZ897ufwY+3dT8Ka43nCSiECzvrbzB7HvMM4+Eg7kT4uf1lihyki/cG51vAr0DAB6 berapF5XIzya1heCtgNor23HCVrUqIGYiWT7nZastfM21IRWsPJDeDwzVIId0rdS+hGp SnpWMmnDmbHQgi1lR+bCH5r9luEZMPfR4AeWcENQfYpWDIojEpMRu8xADRYRpqgaTNEv JArEoGmrQZrYkGq+oUZ4UOC7HzoXmwtJFboFwnEUJTxe2OG6MIZMqAC575J75CWs77cu Qhgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=l6K6giLdbWDFTr2Szse9Gv15KAwz7/DsLW4o+IDcVoU=; b=nJDXa4LsPbzkkB0tpCbJ8RX+oxCIMFSsK+4mqPwKqKHnsKRyFm7FSxPfsgv6Fm5svY cfMDiONGLgnPiga+42S4y1eTu3/uPS3WiV28j19/yRMRn5zReVBCRlGLWdytUwsTuMBA VsJm5AQQqrg+jWG2pLO7O9j13rIOWeaMXxxhO0zEv9+SbzBcu870xHR4KCTCWyDV92Da tA5ZLNAUelrYtA7TXJx9T1ogLnIcHXvXDSIV/sNGVjcBdx6UrD+R/MviEYI5bLD0J4a1 idUTFfQdkOZAuR+uFeMNr97gsUc40PFCIT0pq6WaQg5SFhSzYLbkkD6pKF8aGibm7wpq GfOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t29-v6si14584458pfg.114.2018.06.18.07.22.53; Mon, 18 Jun 2018 07:22:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934732AbeFROWw (ORCPT + 30 others); Mon, 18 Jun 2018 10:22:52 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:44143 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933445AbeFROWu (ORCPT ); Mon, 18 Jun 2018 10:22:50 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0MDl62-1fR8UL45Py-00H7ZT; Mon, 18 Jun 2018 16:22:40 +0200 From: Arnd Bergmann To: Alessandro Zummo , Alexandre Belloni Cc: y2038@lists.linaro.org, Arnd Bergmann , John Stultz , Baolin Wang , Jason Gunthorpe , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rtc: use ktime_get_real_ts64() instead of getnstimeofday64() Date: Mon, 18 Jun 2018 16:22:14 +0200 Message-Id: <20180618142238.3509274-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:K2Lw+Iu4ix/Pc/R17HKwR7RQ9nDkEcx/qZGVyiV3s0CoAhlEAaA NjBUE/D7V+ZVRLh1577DuzTIbImKajTvYg0R6gXAEIY8FiIGi+CEVzQCXxvfqoylzfLFY0U ZeKh10p5txPeS5Io41fxj2kdF2U3Ok/WWL1btTZH5ymO5hOSr5BRL2A2UonHxnUB0W8NWAt n0ekbRKrACo/ONykyjJ1Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:+l6XrIyDNK0=:gnE0nQBY1oRY5LrvEIZzog 7ulKVr/jod7oe7A0LFgl1FqFebZznLSsLlVU6/7OWlt9oKUVU/5v3MJfu55JxexzzYSW3dPyk nWwfR0QjSF5C3sbbpEeS5SShghrVrtraE10um4Cb0MmjI45l12LX7aIpByU9K0TYVlq4yZOsG bFVRQOTgYSOPUpmTiH6x8D2ZATGDgyOpABQdSop7H27wivhUQtoHBVSTGZjEv+Faw0avH3X6F pFZzSJOqHTaCKC01VWzzvjPq9oj+i7VMj8uVkY/mGfYRjgWJrDJkSLQwNlKQyhCoBkeN+Vf3g DJQitoNiza83RsxdNhYCuZk7B3uXXeUlKIc8IO0ZWt5C4oPyxUc2X687t4M1tgaAN01l1Wv3d /3z5UyxIsW8IywwRAKdijQPI0FKDu9guRfbz11D7McNoadJP3qofS+7hlPCtyrkDD6HOuqLt7 neP/l4URFkKFnB9Zadl8q+jzoo2xUUK5sY6fJP3QeFq9HXAKXk0SZ04P0bJuBi3IGU5BBpuR0 BqBHG6h09f7xLVQ1Y/6VCvcLT8ycLOJVCImQeqLhOuux7O2AbznGc35k1/bkekaCkZIh4ZX8K OeRsuXT31QoEoFSmza/cOCq2dE09kVMAftakVDobNoxpAbrzAtBvr/yMKziZe0l7Y2Sp6+BKS 0oWo7bm8vq5KN/u8t8FfiMsaAPx7C3LscKTclKhlzt3DUWSs2UNPFF6oyw6wgapIakYk= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- drivers/rtc/class.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 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));