diff mbox

[V2,43/64] x86: kvm: Use ktime_get_boot_ns()

Message ID 20140716205055.838565297@linutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Gleixner July 16, 2014, 9:04 p.m. UTC
Use the new nanoseconds based interface and get rid of the timespec
conversion dance.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: kvm@vger.kernel.org
---
 arch/x86/kvm/x86.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Paolo Bonzini July 17, 2014, 10:58 a.m. UTC | #1
Il 16/07/2014 23:04, Thomas Gleixner ha scritto:
> Use the new nanoseconds based interface and get rid of the timespec
> conversion dance.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Gleb Natapov <gleb@kernel.org>
> Cc: kvm@vger.kernel.org
> ---
>  arch/x86/kvm/x86.c |    6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> Index: tip/arch/x86/kvm/x86.c
> ===================================================================
> --- tip.orig/arch/x86/kvm/x86.c
> +++ tip/arch/x86/kvm/x86.c
> @@ -1109,11 +1109,7 @@ static void kvm_get_time_scale(uint32_t
>
>  static inline u64 get_kernel_ns(void)
>  {
> -	struct timespec ts;
> -
> -	ktime_get_ts(&ts);
> -	monotonic_to_bootbased(&ts);
> -	return timespec_to_ns(&ts);
> +	return ktime_get_boot_ns();
>  }
>
>  #ifdef CONFIG_X86_64
>
>

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

I will remove get_kernel_ns if you don't do that for me...

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: tip/arch/x86/kvm/x86.c
===================================================================
--- tip.orig/arch/x86/kvm/x86.c
+++ tip/arch/x86/kvm/x86.c
@@ -1109,11 +1109,7 @@  static void kvm_get_time_scale(uint32_t
 
 static inline u64 get_kernel_ns(void)
 {
-	struct timespec ts;
-
-	ktime_get_ts(&ts);
-	monotonic_to_bootbased(&ts);
-	return timespec_to_ns(&ts);
+	return ktime_get_boot_ns();
 }
 
 #ifdef CONFIG_X86_64