diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2019-12-23 14:31:09 +0000 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2020-01-14 12:20:47 +0100 |
commit | cdb7c5a9c897ab2e5c56df647dd84c84e150e925 (patch) | |
tree | 98ef2002f7de486cd573561325d704ccb4d5d73a | |
parent | 8463cf80529d0fd80b84cd5ab8b9b952b01c7eb9 (diff) | |
download | linux-cdb7c5a9c897ab2e5c56df647dd84c84e150e925.tar.bz2 |
lib/vdso: Avoid duplication in __cvdso_clock_getres()
VDSO_HRES and VDSO_RAW clocks are handled the same way.
Avoid the code duplication.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Link: https://lore.kernel.org/r/fdf1a968a8f7edd61456f1689ac44082ebb19c15.1577111367.git.christophe.leroy@c-s.fr
-rw-r--r-- | lib/vdso/gettimeofday.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c index 5a5ec899a21a..fac9e86ef124 100644 --- a/lib/vdso/gettimeofday.c +++ b/lib/vdso/gettimeofday.c @@ -193,7 +193,7 @@ int __cvdso_clock_getres_common(clockid_t clock, struct __kernel_timespec *res) * clocks are handled in the VDSO directly. */ msk = 1U << clock; - if (msk & VDSO_HRES) { + if (msk & (VDSO_HRES | VDSO_RAW)) { /* * Preserves the behaviour of posix_get_hrtimer_res(). */ @@ -203,11 +203,6 @@ int __cvdso_clock_getres_common(clockid_t clock, struct __kernel_timespec *res) * Preserves the behaviour of posix_get_coarse_res(). */ ns = LOW_RES_NSEC; - } else if (msk & VDSO_RAW) { - /* - * Preserves the behaviour of posix_get_hrtimer_res(). - */ - ns = hrtimer_res; } else { return -1; } |