From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752884AbdJTKdX (ORCPT ); Fri, 20 Oct 2017 06:33:23 -0400 Received: from mga05.intel.com ([192.55.52.43]:55756 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752172AbdJTKdV (ORCPT ); Fri, 20 Oct 2017 06:33:21 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,405,1503385200"; d="scan'208";a="1208001996" Subject: Re: [PATCH] usb: xhci: tegra: use time64_t for printing timestamp To: Arnd Bergmann , Greg Kroah-Hartman , Thierry Reding , Jonathan Hunter References: <20171020072006.4174886-1-arnd@arndb.de> Cc: Chunfeng Yun , linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org From: Mathias Nyman Message-ID: <59E9D1DE.9070407@intel.com> Date: Fri, 20 Oct 2017 13:37:18 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20171020072006.4174886-1-arnd@arndb.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20.10.2017 10:19, Arnd Bergmann wrote: > 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, > Thanks, adding to queue -Mathias