From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Nick Crews <ncrews@chromium.org>
Cc: Pavel Machek <pavel@ucw.cz>, Benson Leung <bleung@chromium.org>,
Alessandro Zummo <a.zummo@towertech.it>,
Enric Balletbo i Serra <enric.balletbo@collabora.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Duncan Laurie <dlaurie@chromium.org>
Subject: Re: [PATCH v2 1/2] rtc: wilco-ec: Remove yday and wday calculations
Date: Mon, 23 Sep 2019 22:19:38 +0200 [thread overview]
Message-ID: <20190923201938.GB4141@piout.net> (raw)
In-Reply-To: <CAHX4x876iDn_6Q1+p1SNMncHJezSUQysfM+py0gjD2ytMKBj=w@mail.gmail.com>
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
next prev parent reply other threads:[~2019-09-23 20:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-16 18:12 [PATCH v2 1/2] rtc: wilco-ec: Remove yday and wday calculations Nick Crews
2019-09-16 18:12 ` [PATCH v2 2/2] rtc: wilco-ec: Fix license to GPL from GPLv2 Nick Crews
2019-09-22 20:29 ` Pavel Machek
2019-09-22 20:43 ` Alexandre Belloni
2019-09-23 17:12 ` Nick Crews
2019-09-24 7:55 ` Pavel Machek
2019-09-24 14:37 ` Nick Crews
2019-09-22 16:13 ` [PATCH v2 1/2] rtc: wilco-ec: Remove yday and wday calculations Pavel Machek
2019-09-22 19:05 ` Alexandre Belloni
2019-09-23 17:20 ` Nick Crews
2019-09-23 20:19 ` Alexandre Belloni [this message]
2019-09-25 20:13 ` Nick Crews
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190923201938.GB4141@piout.net \
--to=alexandre.belloni@bootlin.com \
--cc=a.zummo@towertech.it \
--cc=bleung@chromium.org \
--cc=dlaurie@chromium.org \
--cc=enric.balletbo@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ncrews@chromium.org \
--cc=pavel@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).