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: 833383 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-tegra-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3ySSKV5ZvQz9sNw for ; Fri, 3 Nov 2017 01:34:54 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933123AbdKBOex (ORCPT ); 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-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@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 Acked-by: Thierry Reding --- 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,