lkml.org 
[lkml]   [2017]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt
On Thu, Jun 8, 2017 at 3:47 PM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> There are users which print time and date represented by content of
> struct rtc_time in human readable format.
>
> Instead of open coding that each time introduce %pt[dt][rv] specifier.

I really like the idea, and the implementation seems fine for this use case, but
before we reserve %pt for rtc_time, could we discuss whether we want
that for printing struct tm, struct timespec64, time64_t or ktime_t instead?

I can see good reasons for pretty-printing any of them, but the namespace for
format strings is rather limited.

struct rtc_time is almost the same as struct tm (the former has one extra
member), so maybe we can actually define them to be the same and
use one format string for both?

Arnd

\
 
 \ /
  Last update: 2017-06-12 01:30    [W:0.389 / U:2.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site