From patchwork Thu Nov 2 14:34:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 117825 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2246996qgn; Thu, 2 Nov 2017 07:34:57 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RT7VQi7C2uYp5z3M7wn4omj0NXBNuJm2i+/dwDOkLBKfN/71oKn7/GarD+m+Q1hB+aIkZ2 X-Received: by 10.99.96.200 with SMTP id u191mr3882189pgb.307.1509633297491; Thu, 02 Nov 2017 07:34:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509633297; cv=none; d=google.com; s=arc-20160816; b=CnsFR0FG1IBAZY3hVTXdFh3AR+zPenFcez/yQxx208LsxKYhFLoj9kstVamln9CE56 AOIyfi1Mzm/PSx/lFmuJ0Uwd8TLBVcY8cJw3d9IgrO88p2AVU8k22S08gJVv2QTL/Yz7 tigjkPsiza3HzOeSiGVaraDUKMnllWcV42hPyxYIZTXdnKsi2uCowk8LWRXG1+7tXpsg NmcXl2Z58Anlf6PH7nM6PrOc/c4GzheCiBMuD1DHSNKwQwc0ibhwiRz2SNFKa87MteUl uVgWiHs/G1Ekd7/7koz4fgcpsnQvZAeGEdsqz38KFTpIxnL9OZzKpW55YxygcjtpAZ1g nYMg== 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=uSkJM9doJ++nC8vi2iks7Fn4Jx5rJOwPF5qEJkx5/54=; b=KIZLaNkW/aC/jyazdJpsLz6FNFG5O1UeHxtDcRlcrceAhqYemddx4mrmA/8DOQC7u4 w/jIPaEHdTRoA+KbPPI8PRWC/K8ubKqh1nHEsqapvZY72jVtnT1BDScZdmA1Hea6hQ2r pQ4W+z2XmmP1dY8eecZ/3fGHEMN6Jk413J26rgIYvpZ6x8Iocd0m+0T6aVMUiD+LU9uH 03jmJkyq4WBB1e+F3u5CrBvXEtPzBjX8H1jzRS5JLKSDbn93xAq6zOyPr1AcFYn83wb1 a6j4cnqJWQDlJbYtnpYI609+4MYKzS8M63+QJ/A+Xw8wO02tRr3O1HhJGUDQPz2CSRIK fqrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-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 g125si4194737pfc.0.2017.11.02.07.34.57; Thu, 02 Nov 2017 07:34:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-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-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933349AbdKBOex (ORCPT + 3 others); Thu, 2 Nov 2017 10:34:53 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:53152 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933034AbdKBOew (ORCPT ); Thu, 2 Nov 2017 10:34:52 -0400 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0Letrj-1dM3RC3Ph9-00qn77; Thu, 02 Nov 2017 15:34:37 +0100 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: Thu, 2 Nov 2017 15:34:27 +0100 Message-Id: <20171102143435.882290-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:DoLILdCQWRTyOpyW1+cFXXKGH+UbxJ1Hf5J+nN0t3qpnAd9d5Wl XcsUwfPVSq7j3UXSksOJ/2G9WRbbQKIQQCI1Po2l+8xI23G78GaIdoz46Bxdw3umbk8w+mh i2U6Msj332EWLJ/ke2moXGCkaC6OIAqBxeEdGrBzEe+7qxjEhkmDME7xWhOCmFLKTAi4hLp rIcjbDUlTJT6YB0ycG9lQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:8Fo+0ua3X4g=:i5I6e5Cu8unQC7/ZKw8w5v 8+VsCjHuRPNaYeMFY+YAtYtlRXnOtTc+H2/UcitVJjoysZ9YXIKDYqNzhzIDkHK6yWTZxuaPZ cfNqju6v7dywVgBuZTolIYqjUUP8ixohNaAWjmnrpgo/gCJkzwiHrehFSTDWK4PNhh6Z6Qs2U waKTY8fQhanrVe5X/ZxwaJGu89BSMBQXJTKfdMI5oFBSV6H9AtsUtnlLuaxJocU71718/wuES 8EAAhUFncUuu7I4bgXRb0AVB1Ai0QCLVNRvhmQcTzPW/7dCzKBWUplmcX39ud293N5OYZaNFh +KF7VSEaN0G8jfy7YorYTvHi4EB3xi24vQb9scQ6X5gaoNqu10APPv/VEYnzoceMFyw14trZR z8+/AeLInWWdUTWnRO82saiWNxFU4wpQzkTyRuJf7Lkf9UK8bFt6RZqqWBbD6C5f3fPtHefXf gMs9OBQauvGkW0qUNl4F8lNxQdHwRV1xN+/vjuJlwRupiwhvkpYksphTCwfpYkc5aGMpmnpiv 3tkALwcn8tWotU19eQVdYQJIev0Pf63mn1wAcEJ7FdcZmDQAhqoxkimh+9b2zjIlSoL8hip2A mNQDmXvCsjQy3H+jobFKTVVycQ5QqTgip1X09yLYbykzZXGOTwMI9aeTJjyftI1qc5b/eFkNv qe13BjCdCqKc9D9BQJB0nRklsdGnLmKIhQ5KYlTt5j8APSPWHhqXxvPhO9lNrdjKPdVmAbbH/ p0z51AIZukkrJeVP4WyrzSqw3ByJoChpWAHJIw== Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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,