[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180221091637.GK18058@piout.net>
Date: Wed, 21 Feb 2018 10:16:37 +0100
From: Alexandre Belloni <alexandre.belloni@...e-electrons.com>
To: Joe Perches <joe@...ches.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Rasmus Villemoes <rasmus.villemoes@...vas.dk>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org,
Alessandro Zummo <a.zummo@...ertech.it>,
linux-rtc@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
Mark Salyzyn <salyzyn@...roid.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
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 v2 01/21] lib/vsprintf: Print time and date in human
readable format via %pt
On 20/02/2018 at 15:55:07 -0800, Joe Perches wrote:
> On Tue, 2018-02-20 at 23:43 +0200, Andy Shevchenko wrote:
> > +static noinline_for_stack
> > +char *time_str(char *buf, char *end, const struct rtc_time *tm, bool v, bool r)
> > +{
>
> Maybe use unsigned int temporaries here too for hour, min, sec
>
> > + if (unlikely(v && (unsigned int)tm->tm_hour > 24))
> > + buf = string(buf, end, "**", default_str_spec);
> > + else
> > + buf = number(buf, end, tm->tm_hour, default_dec02_spec);
> > +
> > + if (buf < end)
> > + *buf = ':';
> > + buf++;
> > +
> > + if (unlikely(v && (unsigned int)tm->tm_min > 59))
>
> leap seconds are allowed in the struct
>
No, they are not:
https://elixir.bootlin.com/linux/v4.15.4/source/drivers/rtc/rtc-lib.c#L108
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists