From patchwork Fri Oct 20 07:19:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 116461 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1366018qgn; Fri, 20 Oct 2017 00:20:31 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QrqHUSD5+jRB4uFIUmw2k7WKj+BdwEA9Y7kaupRpnVWnNvh/9s9thtshTW3+3BghhQzC8J X-Received: by 10.98.242.15 with SMTP id m15mr4033743pfh.176.1508484031209; Fri, 20 Oct 2017 00:20:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508484031; cv=none; d=google.com; s=arc-20160816; b=mCDGQXQ5m3kzUmt5CTd4yxJ1qwXqd35nmQgltDL2hOGOwXZJ0IFDoGA3nAi+7HRl9T E2V4C22E0akbJtxf0TIYu/c0ka8qGRZAB3nYDVc+yc7B5RMUSQJb/gcSJFelrwzR1UOw nVutwfOjnmFDAP6nPHVhPuJcdmms6hR9XYKwGRpj5qRPjMMJPDpTzzmJAlgOenVG7I49 3kJ1k6cv+r9hU7eYOQhJTeLnln0HRNzC/ANN/Dq2t8CeDxRQE5vaFXdwH0qkET7pzr8j izefkt1Owh+wg/OVtqUPouxLu6oUBxZIv56QAMaCa5vdprgO4Qg+sqnnRkTneZ3vJuYk jMAg== 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=7XpUfyj+qeBablP79J4CVsKFD5ObZu/jLqWRsEfv1+Y=; b=OjVNMIcdaQqg47Y25/zmnrlZJyb/hmXV3hoL34aYD8SXfJd5v5dWE3gn7xmMujaxct x5iI88v3NbKpDBr5LyucP+SbsaALVk2sv7ciS5oOMZjHvSNESBzlp26BTIUHt76Ov68I l5aEqVXpSP+njRJVHNdIBDtcNpJP68L1fqOBhYxfP+Uf/Osd/p7ixzmUHLkOpFd2NWxX 9aEDVKBFdOFq+aOUY9WKytNyw1aYL5HpPgCLEJ6DO4XzCL3OPGdHLLLM4cyKob6u2GYK u/TvIoi0hJZv+R+dx7/9wtXWCYds5Nhr1iBU2s8cbvf5BJEjoikMyN/OJbs6umreUSfi iuTQ== 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 p25si343494pgn.126.2017.10.20.00.20.30; Fri, 20 Oct 2017 00:20:31 -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 S1751975AbdJTHU3 (ORCPT + 27 others); Fri, 20 Oct 2017 03:20:29 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:57504 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751792AbdJTHU1 (ORCPT ); Fri, 20 Oct 2017 03:20:27 -0400 Received: from wuerfel.lan ([46.223.139.202]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0LyDvp-1dAzQS0f1J-015Yvm; Fri, 20 Oct 2017 09:20:09 +0200 From: Arnd Bergmann To: Mathias Nyman , Greg Kroah-Hartman , Thierry Reding , Jonathan Hunter Cc: Arnd Bergmann , Chunfeng Yun , linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: xhci: tegra: use time64_t for printing timestamp Date: Fri, 20 Oct 2017 09:19:54 +0200 Message-Id: <20171020072006.4174886-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:o7JyOM+JcWdw69zK5HZFVkA+RtYnjyrZEuRcdsKS+PDmIZjOzP9 9cd+8spfx/31DiD/+vw9hUfkoRCfrgecHfm1C2INjqOKbKLcDEijgj/prFPCdZdZmayfPvg cXQtfNu89+e0ngcYYeq7WCEbAsRIiEPmy0xO0Eq5kwbqdwJaysEk9Q3g3MGXZuGZwdSMtlA RvQPJJaaZiw0incsF+iqw== X-UI-Out-Filterresults: notjunk:1; V01:K0:MVGwJ/O/IiI=:/iZ4NCwBMAa4bo2X1xLMF+ 1TIr3zendxata2RxVKdITokFJVXozzr9UW1ffLPjvztJCd9r91CEVwmlWkGB1phDXzcqZtiqy lEszpowy43rCK65+cKSQ7IeVsMzB/Ycyk1vl1t7bbQV2bVjZrYuctwIGGdZPX4FkLzEiNnSI2 TYMbDHKSoamJQ9/htaxvXG2CGr/p5k/iJSUe97MIzksG8OhCISjyRZdUXciIOWKa6UDE6Nfo6 DIYj9sFVi4H7JJ3ByJv21S3SHAtH0JwOfVrdkzZrNOjeoWZZUwiH4EL/kq6PiWZAq6VBdnAVY 2aBE57A9dIH0+MkdSICTYHTi/gkZcofctpTc1Lgsw+Oj8PjsHAqW9pxZ/fTxQQuL4Ex2phEhz LdcKP+7629tahoqmzjrW6kh7ul3m7oFWhhvPlL3IymAJ9hoevM9QZjHzzYM7GdQ8UcQGyjOCG mdT/fWlU1T5QLFkWoV0YuJV9h3JFmvala9J4SeFMpVr8tRCXLUk6xjx6EiwBHj9v+NnJXL20M e0LHWeZJZQ99zMMdcFXI9ld+j4V5wAwuPIE8GSi8bAO1pI2bEFx2ffIvm0aGP8XmOh9+l84+d Jomxs83/fIQ4yuojZq372ftaEjDnl5Sditkv4YNvfkwJE3hf5WrEvFfuJjShzlfjDxwuKPOML m8rFCRN4PyoqWsuLPmtpXFl4T2vVUG1vkx+7M83PBnR4hbcQ15CqGigqXnQ0kXTpzpcSMUC8l RwX5cI1hkuVKJtXyrQc1dZ5Mz6RLNTo5dNrwKA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The time_t type and time_to_tm() function are deprecated because of y2038 problems. In this driver, they are used to pretty-print the timestamp of the firmware build. This is fine as long as we don't get a firmware build past 2038. Converting to time64_t and time64_to_tm() avoids the deprecated interfaces and works until 2106, when the firmware-defined data structure overflows. Signed-off-by: Arnd Bergmann --- drivers/usb/host/xhci-tegra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c index 74436f8ca538..39b6e93130d3 100644 --- a/drivers/usb/host/xhci-tegra.c +++ b/drivers/usb/host/xhci-tegra.c @@ -771,7 +771,7 @@ static int tegra_xusb_load_firmware(struct tegra_xusb *tegra) struct device *dev = tegra->dev; const struct firmware *fw; unsigned long timeout; - time_t timestamp; + time64_t timestamp; struct tm time; u64 address; u32 value; @@ -877,7 +877,7 @@ static int tegra_xusb_load_firmware(struct tegra_xusb *tegra) } timestamp = le32_to_cpu(header->fwimg_created_time); - time_to_tm(timestamp, 0, &time); + time64_to_tm(timestamp, 0, &time); dev_info(dev, "Firmware timestamp: %ld-%02d-%02d %02d:%02d:%02d UTC\n", time.tm_year + 1900, time.tm_mon + 1, time.tm_mday,