lkml.org 
[lkml]   [2019]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] rtc: wilco-ec: Remove yday and wday calculations
On 23/09/2019 11:20:42-0600, Nick Crews wrote:
> > This is coming from struct tm, it is part of C89 but I think I was not
> > born when this decision was made. man rtc properly reports that those
> > fields are unused and no userspace tools are actually making use of
> > them. Nobody cares about the broken down representation of the time.
> > What is done is use the ioctl then mktime to have a UNIX timestamp.
> >
> > "The mktime function ignores the specified contents of the tm_wday,
> > tm_yday, tm_gmtoff, and tm_zone members of the broken-down time
> > structure. It uses the values of the other components to determine the
> > calendar time; it’s permissible for these components to have
> > unnormalized values outside their normal ranges. The last thing that
> > mktime does is adjust the components of the brokentime structure,
> > including the members that were initially ignored."
>
> This is very non-obvious and I only knew this from talking to you,
> Alexandre. Perhaps we should add this note to the RTC core,
> such as in the description for rtc_class_ops?
>

I'm planning to add documentation on what should be done in an RTC
driver, I'll ensure to add something on this topic.

> For this patch, do you want me to make any further changes?
>

No need for any changes, however, I can't apply it right now because we
are in the middle of the merge window.


--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

\
 
 \ /
  Last update: 2019-09-23 22:20    [W:0.068 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site