[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210326112724.1563-1-zuoqilin1@163.com>
Date: Fri, 26 Mar 2021 19:27:24 +0800
From: zuoqilin1@....com
To: mingo@...hat.com, bp@...en8.de, x86@...nel.org, hpa@...or.com
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
zuoqilin <zuoqilin@...ong.com>
Subject: [PATCH] x86: Simplify the return expression
From: zuoqilin <zuoqilin@...ong.com>
Simplify the return expression of kvm_compute_tsc_offset().
Signed-off-by: zuoqilin <zuoqilin@...ong.com>
---
arch/x86/kvm/x86.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index fe806e8..3906c1b 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2209,11 +2209,7 @@ u64 kvm_scale_tsc(struct kvm_vcpu *vcpu, u64 tsc)
static u64 kvm_compute_tsc_offset(struct kvm_vcpu *vcpu, u64 target_tsc)
{
- u64 tsc;
-
- tsc = kvm_scale_tsc(vcpu, rdtsc());
-
- return target_tsc - tsc;
+ return target_tsc - kvm_scale_tsc(vcpu, rdtsc());
}
u64 kvm_read_l1_tsc(struct kvm_vcpu *vcpu, u64 host_tsc)
--
1.9.1
Powered by blists - more mailing lists