lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200421130846.GM185537@smile.fi.intel.com>
Date:   Tue, 21 Apr 2020 16:08:46 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Sergey Senozhatsky <sergey.senozhatsky@...il.com>
Cc:     Petr Mladek <pmladek@...e.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        linux-kernel@...r.kernel.org,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Hans Verkuil <hverkuil@...all.nl>,
        Jonathan Corbet <corbet@....net>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>
Subject: Re: [PATCH v3 1/3] lib/vsprintf: Print time64_t in human readable
 format

On Thu, Apr 16, 2020 at 11:32:19AM +0900, Sergey Senozhatsky wrote:
> On (20/04/15 20:00), Andy Shevchenko wrote:
> [..]
> >  #include <linux/of.h>
> >  #include <net/addrconf.h>
> > @@ -1819,6 +1820,29 @@ char *rtc_str(char *buf, char *end, const struct rtc_time *tm,
> >  	return buf;
> >  }
> >  
> > +static noinline_for_stack
> > +char *time64_str(char *buf, char *end, const time64_t time,
> > +		 struct printf_spec spec, const char *fmt)
> > +{
> > +	struct rtc_time rtc_time;
> > +	struct tm tm;
> > +
> > +	time64_to_tm(time, 0, &tm);
> > +
> > +	rtc_time.tm_sec = tm.tm_sec;
> > +	rtc_time.tm_min = tm.tm_min;
> > +	rtc_time.tm_hour = tm.tm_hour;
> > +	rtc_time.tm_mday = tm.tm_mday;
> > +	rtc_time.tm_mon = tm.tm_mon;
> > +	rtc_time.tm_year = tm.tm_year;
> > +	rtc_time.tm_wday = tm.tm_wday;
> > +	rtc_time.tm_yday = tm.tm_yday;
> > +
> > +	rtc_time.tm_isdst = 0;
> 
> Here you convert time64_t (signed, we also have unsigned version - timeu64_t)
> to tm first and then convert tm to rtc_time. Will rtc_time64_to_tm() do the
> trick?

You missed v2 round. The RTC is configuration dependent and Alexandre in favour
of removing those from RTC completely by replacing with always enabled
time64_to_tm().

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ