Re: [PATCH[ RTC: Add rtc_year_days() to calculate tm_yday

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux