[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181204161242.GD10650@smile.fi.intel.com>
Date: Tue, 4 Dec 2018 18:12:42 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Petr Mladek <pmladek@...e.com>
Cc: Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
linux-rtc@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
Joe Perches <joe@...ches.com>,
Mark Salyzyn <salyzyn@...roid.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
linux-kernel@...r.kernel.org,
Rasmus Villemoes <rasmus.villemoes@...vas.dk>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Guan Xuetao <gxt@...c.pku.edu.cn>,
Ingo Molnar <mingo@...nel.org>,
Jason Wessel <jason.wessel@...driver.com>,
Jonathan Corbet <corbet@....net>,
Jonathan Hunter <jonathanh@...dia.com>,
Krzysztof Kozlowski <krzk@...nel.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Thierry Reding <thierry.reding@...il.com>
Subject: Re: [PATCH v5 02/21] lib/vsprintf: Print time and date in human
readable format via %pt
On Tue, Dec 04, 2018 at 02:30:28PM +0100, Petr Mladek wrote:
> On Thu 2018-11-29 12:59:40, Andy Shevchenko 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 %ptR[dt][r] specifier.
> > +static void __init
> > +struct_rtc_time(void)
> > +{
> > +}
>
> Just by chance, do you have any plans to add the test code? ;-)
>
> I understand that you did now want to spend time on it before
> the real change was accepted.
You see, there were several iterations with no consensus on everything:
specifier format changed 3 times, for example.
But it might be good idea to eventually add couple simple tests at some point.
Is it a show stopper?
> > + found = true;
> > + do {
> > + switch (fmt[count++]) {
> > + case 'r':
> > + raw = true;
> > + break;
> > + default:
> > + found = false;
> > + break;
> > + }
> > + } while (found);
>
> I guess that the while cycle is remainder from an older version and
> should not be here. It handles only the final 'r' now.
See again above. Do you insist to make a change now?
> > + if (have_d)
> > + buf = date_str(buf, end, tm, raw);
> > + if (have_d && have_t) {
> > + /* Respect ISO 8601 */
> > + if (buf < end)
> > + *buf = 'T';
>
> I checked several conversion patches and the original code did not use
> the ISO format. The change makes sense (even though I personally
> do not like the format much ;-)
>
> Anyway, people might expect that the conversion is 1:1. The change
> should get mentioned in the affected patches so that people are
> not later surprised.
It's defined in cover letter, all ABI cases are _not_ changed.
The rest either information or, in most cases, debug messages.
Alexandre is OK with the change, he actually requested this.
> > +static noinline_for_stack
> > +char *timeanddate(char *buf, char *end, void *ptr, struct printf_spec spec,
> > + const char *fmt)
>
> Please, rename the function to time_and_date(). It is the style used
> in this source file and it is much easier to read.
OK.
> Otherwise, the patch looks fine. It helps to remove the many variants
> of the code and unifies the output format.
Thanks for review!
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists