lkml.org 
[lkml]   [2018]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2018-02-21 10:18    [W:0.155 / U:0.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site