@@ -22,14 +22,14 @@ extern int do_sys_settimeofday64(const struct timespec64 *tv,
2222 const struct timezone * tz );
2323
2424/*
25- * ktime_get() family: read the current time in a multitude of ways,
25+ * ktime_get() family - read the current time in a multitude of ways.
2626 *
2727 * The default time reference is CLOCK_MONOTONIC, starting at
2828 * boot time but not counting the time spent in suspend.
2929 * For other references, use the functions with "real", "clocktai",
3030 * "boottime" and "raw" suffixes.
3131 *
32- * To get the time in a different format, use the ones wit
32+ * To get the time in a different format, use the ones with
3333 * "ns", "ts64" and "seconds" suffix.
3434 *
3535 * See Documentation/core-api/timekeeping.rst for more details.
@@ -74,6 +74,8 @@ extern u32 ktime_get_resolution_ns(void);
7474
7575/**
7676 * ktime_get_real - get the real (wall-) time in ktime_t format
77+ *
78+ * Returns: real (wall) time in ktime_t format
7779 */
7880static inline ktime_t ktime_get_real (void )
7981{
@@ -86,10 +88,12 @@ static inline ktime_t ktime_get_coarse_real(void)
8688}
8789
8890/**
89- * ktime_get_boottime - Returns monotonic time since boot in ktime_t format
91+ * ktime_get_boottime - Get monotonic time since boot in ktime_t format
9092 *
9193 * This is similar to CLOCK_MONTONIC/ktime_get, but also includes the
9294 * time spent in suspend.
95+ *
96+ * Returns: monotonic time since boot in ktime_t format
9397 */
9498static inline ktime_t ktime_get_boottime (void )
9599{
@@ -102,7 +106,9 @@ static inline ktime_t ktime_get_coarse_boottime(void)
102106}
103107
104108/**
105- * ktime_get_clocktai - Returns the TAI time of day in ktime_t format
109+ * ktime_get_clocktai - Get the TAI time of day in ktime_t format
110+ *
111+ * Returns: the TAI time of day in ktime_t format
106112 */
107113static inline ktime_t ktime_get_clocktai (void )
108114{
@@ -144,32 +150,60 @@ static inline u64 ktime_get_coarse_clocktai_ns(void)
144150
145151/**
146152 * ktime_mono_to_real - Convert monotonic time to clock realtime
153+ * @mono: monotonic time to convert
154+ *
155+ * Returns: time converted to realtime clock
147156 */
148157static inline ktime_t ktime_mono_to_real (ktime_t mono )
149158{
150159 return ktime_mono_to_any (mono , TK_OFFS_REAL );
151160}
152161
162+ /**
163+ * ktime_get_ns - Get the current time in nanoseconds
164+ *
165+ * Returns: current time converted to nanoseconds
166+ */
153167static inline u64 ktime_get_ns (void )
154168{
155169 return ktime_to_ns (ktime_get ());
156170}
157171
172+ /**
173+ * ktime_get_real_ns - Get the current real/wall time in nanoseconds
174+ *
175+ * Returns: current real time converted to nanoseconds
176+ */
158177static inline u64 ktime_get_real_ns (void )
159178{
160179 return ktime_to_ns (ktime_get_real ());
161180}
162181
182+ /**
183+ * ktime_get_boottime_ns - Get the monotonic time since boot in nanoseconds
184+ *
185+ * Returns: current boottime converted to nanoseconds
186+ */
163187static inline u64 ktime_get_boottime_ns (void )
164188{
165189 return ktime_to_ns (ktime_get_boottime ());
166190}
167191
192+ /**
193+ * ktime_get_clocktai_ns - Get the current TAI time of day in nanoseconds
194+ *
195+ * Returns: current TAI time converted to nanoseconds
196+ */
168197static inline u64 ktime_get_clocktai_ns (void )
169198{
170199 return ktime_to_ns (ktime_get_clocktai ());
171200}
172201
202+ /**
203+ * ktime_get_raw_ns - Get the raw monotonic time in nanoseconds
204+ *
205+ * Returns: current raw monotonic time converted to nanoseconds
206+ */
173207static inline u64 ktime_get_raw_ns (void )
174208{
175209 return ktime_to_ns (ktime_get_raw ());
@@ -224,8 +258,8 @@ extern bool timekeeping_rtc_skipresume(void);
224258
225259extern void timekeeping_inject_sleeptime64 (const struct timespec64 * delta );
226260
227- /*
228- * struct ktime_timestanps - Simultaneous mono/boot/real timestamps
261+ /**
262+ * struct ktime_timestamps - Simultaneous mono/boot/real timestamps
229263 * @mono: Monotonic timestamp
230264 * @boot: Boottime timestamp
231265 * @real: Realtime timestamp
@@ -242,7 +276,8 @@ struct ktime_timestamps {
242276 * @cycles: Clocksource counter value to produce the system times
243277 * @real: Realtime system time
244278 * @raw: Monotonic raw system time
245- * @clock_was_set_seq: The sequence number of clock was set events
279+ * @cs_id: Clocksource ID
280+ * @clock_was_set_seq: The sequence number of clock-was-set events
246281 * @cs_was_changed_seq: The sequence number of clocksource change events
247282 */
248283struct system_time_snapshot {
0 commit comments