From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933480AbdKBOey (ORCPT ); Thu, 2 Nov 2017 10:34:54 -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 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-kernel-owner@vger.kernel.org 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(-) 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, -- 2.9.0