Lines Matching refs:tm
50 * @tm: Pointer to the struct rtc_time.
52 void rtc_time64_to_tm(time64_t time, struct rtc_time *tm)
66 tm->tm_wday = (days + 4) % 7;
130 tm->tm_year = (int) (year - 1900);
131 tm->tm_mon = (int) month;
132 tm->tm_mday = (int) day;
133 tm->tm_yday = (int) day_of_year + 1;
135 tm->tm_hour = secs / 3600;
136 secs -= tm->tm_hour * 3600;
137 tm->tm_min = secs / 60;
138 tm->tm_sec = secs - tm->tm_min * 60;
140 tm->tm_isdst = 0;
147 int rtc_valid_tm(struct rtc_time *tm)
149 if (tm->tm_year < 70 ||
150 tm->tm_year > (INT_MAX - 1900) ||
151 ((unsigned int)tm->tm_mon) >= 12 ||
152 tm->tm_mday < 1 ||
153 tm->tm_mday > rtc_month_days(tm->tm_mon,
154 ((unsigned int)tm->tm_year + 1900)) ||
155 ((unsigned int)tm->tm_hour) >= 24 ||
156 ((unsigned int)tm->tm_min) >= 60 ||
157 ((unsigned int)tm->tm_sec) >= 60)
168 time64_t rtc_tm_to_time64(struct rtc_time *tm)
170 return mktime64(((unsigned int)tm->tm_year + 1900), tm->tm_mon + 1,
171 tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
178 ktime_t rtc_tm_to_ktime(struct rtc_time tm)
180 return ktime_set(rtc_tm_to_time64(&tm), 0);