Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5264d5d authored by Thomas Gleixner's avatar Thomas Gleixner Committed by John Stultz
Browse files

timekeeping: Use ktime_t based data for ktime_get_real()



Speed up the readout.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
parent 0077dc60
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -108,11 +108,18 @@ enum tk_offsets {

extern ktime_t ktime_get(void);
extern ktime_t ktime_get_with_offset(enum tk_offsets offs);
extern ktime_t ktime_get_real(void);
extern ktime_t ktime_get_boottime(void);
extern ktime_t ktime_get_monotonic_offset(void);
extern ktime_t ktime_get_clocktai(void);

/**
 * ktime_get_real - get the real (wall-) time in ktime_t format
 */
static inline ktime_t ktime_get_real(void)
{
	return ktime_get_with_offset(TK_OFFS_REAL);
}

/*
 * RTC specific
 */
+0 −15
Original line number Diff line number Diff line
@@ -773,21 +773,6 @@ int timekeeping_notify(struct clocksource *clock)
	return tk->clock == clock ? 0 : -1;
}

/**
 * ktime_get_real - get the real (wall-) time in ktime_t format
 *
 * returns the time in ktime_t format
 */
ktime_t ktime_get_real(void)
{
	struct timespec64 now;

	getnstimeofday64(&now);

	return timespec64_to_ktime(now);
}
EXPORT_SYMBOL_GPL(ktime_get_real);

/**
 * getrawmonotonic - Returns the raw monotonic time in a timespec
 * @ts:		pointer to the timespec to be set