public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH[ RTC: Add rtc_year_days() to calculate tm_yday
Date: Wed, 7 Jun 2006 15:48:31 -0700 (PDT)	[thread overview]
Message-ID: <e67l3v$k2q$1@terminus.zytor.com> (raw)
In-Reply-To: 20060607193311.GH13165@flint.arm.linux.org.uk

Followup to:  <20060607193311.GH13165@flint.arm.linux.org.uk>
By author:    Russell King <rmk+lkml@arm.linux.org.uk>
In newsgroup: linux.dev.kernel
>
> On Wed, Jun 07, 2006 at 08:26:09PM +0200, Andrew Victor wrote:
> > 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".
> 

"Be conservative in what you send, liberal in what you accept."

	- Mr. Protocol

In this case it seems a good idea to set these fields correctly, but
not rely upon them, unless there are known cases where that causes
trouble.

	-hpa

  reply	other threads:[~2006-06-07 22:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-07 18:26 [PATCH[ RTC: Add rtc_year_days() to calculate tm_yday Andrew Victor
2006-06-07 19:33 ` Russell King
2006-06-07 22:48   ` H. Peter Anvin [this message]
2006-06-08  6:43   ` Andrew Victor

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='e67l3v$k2q$1@terminus.zytor.com' \
    --to=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    /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