Couple of items for 3.20
* ktime division optimization * Expose a few more y2038-safe timekeeping interfaces * RTC core changes to address y2038 Signed-off-by: John Stultz <john.stultz@linaro.org> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJUwvXJAAoJEK8vClot3jMxTAoH/1DMT3fuVx6RFjKJ/P1abIB+ +w3cfEgEWgkSwYmuS0XHq1WppnQ0p0n1GOJcWUPiP9tTGrKcTdp5uG5qMprcga3q XoeR8wefkyEKyH4ukStdGKQKot2Vj117TauDtVNPf2eOOBS5pqOw1dYUlwjlMtOj 45poW5ORNKmBMn90e22k8nlNSI9PebvMh9w6nzeYJWEibdyk96z2TOk1puPTvws/ ppyNzlhnKckpNb49JVxE8B4DNRpXsUV+aUxRNyRPN4OdqCGzHwIJCyEKi6+nbRyb 4HMUhfl8eRB2Iu7zHF2a2XEOqJdOjl8i1DsTwr3Vwd3crf4XkXD6WtTtGl2YKkU= =YhDu -----END PGP SIGNATURE----- Merge tag 'fortglx-3.20-time' of https://git.linaro.org/people/john.stultz/linux into timers/core Pull time updates from John Stultz for 3.20: * ktime division optimization * Expose a few more y2038-safe timekeeping interfaces * RTC core changes to address y2038
This commit is contained in:
commit
fe31fca35d
10 changed files with 63 additions and 46 deletions
|
|
@ -166,7 +166,17 @@ static inline bool ktime_before(const ktime_t cmp1, const ktime_t cmp2)
|
|||
}
|
||||
|
||||
#if BITS_PER_LONG < 64
|
||||
extern u64 ktime_divns(const ktime_t kt, s64 div);
|
||||
extern u64 __ktime_divns(const ktime_t kt, s64 div);
|
||||
static inline u64 ktime_divns(const ktime_t kt, s64 div)
|
||||
{
|
||||
if (__builtin_constant_p(div) && !(div >> 32)) {
|
||||
u64 ns = kt.tv64;
|
||||
do_div(ns, div);
|
||||
return ns;
|
||||
} else {
|
||||
return __ktime_divns(kt, div);
|
||||
}
|
||||
}
|
||||
#else /* BITS_PER_LONG < 64 */
|
||||
# define ktime_divns(kt, div) (u64)((kt).tv64 / (div))
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue