From: Andrew Victor <andrew@sanpeople.com>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: linux-kernel@vger.kernel.org, alessandro.zummo@towertech.it,
akpm@osdl.org
Subject: Re: [PATCH[ RTC: Add rtc_year_days() to calculate tm_yday
Date: 08 Jun 2006 08:43:36 +0200 [thread overview]
Message-ID: <1149749016.2114.26.camel@fuzzie.sanpeople.com> (raw)
In-Reply-To: <20060607193311.GH13165@flint.arm.linux.org.uk>
hi Russell,
> > RTC: Add exported function rtc_year_days() to calculate the tm_yday
> > value.
>
> Is there a good reason for this? I ask the question because the x86
> /dev/rtc driver says:
>
> * Only the values that we read from the RTC are set. We leave
> * tm_wday, tm_yday and tm_isdst untouched. Note that while the
> * RTC has RTC_DAY_OF_WEEK, we should usually ignore it, as it is
> * only updated by the RTC when initially set to a non-zero value.
>
> So it seems the established modus operandi for RTC interfaces is "don't
> trust wday, yday and isdst".
wday and yday are already being calculated by rtc_time_to_tm() in
drivers/rtc/rtc-lib.c, and this function is used by about half of the
RTC class drivers.
Since yday can also be easily calculated from dd/mm/yyyy, I don't see
why those drivers who don't use rtc_time_to_tm() can't also return a
valid yday value.
Regards,
Andrew Victor
prev parent reply other threads:[~2006-06-08 6:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-07 18:26 Andrew Victor
2006-06-07 19:33 ` Russell King
2006-06-07 22:48 ` H. Peter Anvin
2006-06-08 6:43 ` Andrew Victor [this message]
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=1149749016.2114.26.camel@fuzzie.sanpeople.com \
--to=andrew@sanpeople.com \
--cc=akpm@osdl.org \
--cc=alessandro.zummo@towertech.it \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+lkml@arm.linux.org.uk \
/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
all inboxes | Powered by JetHome®