Re: [PATCH v1 4/4] usb: host: xhci-tegra: Switch to use %ptT

From: Andy Shevchenko
Date: Tue Oct 01 2019 - 10:41:40 EST


On Tue, Oct 1, 2019 at 4:33 PM Thierry Reding <thierry.reding@xxxxxxxxx> wrote:
> On Fri, Jan 04, 2019 at 09:30:09PM +0200, Andy Shevchenko wrote:
> > Use %ptT instead of open coded variant to print content of
> > time64_t type in human readable format.

> > - dev_info(dev, "Firmware timestamp: %ld-%02d-%02d %02d:%02d:%02d UTC\n",
> > - time.tm_year + 1900, time.tm_mon + 1, time.tm_mday,
> > - time.tm_hour, time.tm_min, time.tm_sec);
> > + dev_info(dev, "Firmware timestamp: %ptT UTC\n", &timestamp);
>
> If I understand correctly, this will now print:
>
> Firmware timestamp: YYYY-mm-ddTHH:MM:SS UTC
>
> whereas it earlier printed:
>
> Firmware timestamp: YYYY-mm-dd HH:MM:SS UTC
>
> So the 'T' character is different now.

> Could we make this something
> along the lines of:
>
> dev_info(dev, "Firmware timestamp: %ptTd %ptTt UTC\n", &timestamp,
> &timestamp);
>
> To keep the output identical?

Yes, we can...

> It's possible that there are some scripts
> that parse the log to find out which firmware was loaded.

...but if you have scripts parsing kernel log, something is odd.
As far as I understand kernel log isn't ABI, no-one should rely on its output.

--
With Best Regards,
Andy Shevchenko