lkml.org 
[lkml]   [2006]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH[ RTC: Add rtc_year_days() to calculate tm_yday
Date
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-08 00:51    [W:1.064 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site