mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 05:17:10 +09:00
Merge tag 'v4.9.132' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-4.9.y
This is the 4.9.132 stable release
This commit is contained in:
@@ -709,6 +709,16 @@ u64 nsec_to_clock_t(u64 x)
|
||||
#endif
|
||||
}
|
||||
|
||||
u64 jiffies64_to_nsecs(u64 j)
|
||||
{
|
||||
#if !(NSEC_PER_SEC % HZ)
|
||||
return (NSEC_PER_SEC / HZ) * j;
|
||||
# else
|
||||
return div_u64(j * HZ_TO_NSEC_NUM, HZ_TO_NSEC_DEN);
|
||||
#endif
|
||||
}
|
||||
EXPORT_SYMBOL(jiffies64_to_nsecs);
|
||||
|
||||
/**
|
||||
* nsecs_to_jiffies64 - Convert nsecs in u64 to jiffies64
|
||||
*
|
||||
|
||||
@@ -98,6 +98,12 @@ define timeconst(hz) {
|
||||
print "#define HZ_TO_USEC_DEN\t\t", hz/cd, "\n"
|
||||
print "#define USEC_TO_HZ_NUM\t\t", hz/cd, "\n"
|
||||
print "#define USEC_TO_HZ_DEN\t\t", 1000000/cd, "\n"
|
||||
|
||||
cd=gcd(hz,1000000000)
|
||||
print "#define HZ_TO_NSEC_NUM\t\t", 1000000000/cd, "\n"
|
||||
print "#define HZ_TO_NSEC_DEN\t\t", hz/cd, "\n"
|
||||
print "#define NSEC_TO_HZ_NUM\t\t", hz/cd, "\n"
|
||||
print "#define NSEC_TO_HZ_DEN\t\t", 1000000000/cd, "\n"
|
||||
print "\n"
|
||||
|
||||
print "#endif /* KERNEL_TIMECONST_H */\n"
|
||||
|
||||
Reference in New Issue
Block a user