* [PATCH] x86: Simplify the return expression
@ 2021-03-26 11:27 zuoqilin1
0 siblings, 0 replies; only message in thread
From: zuoqilin1 @ 2021-03-26 11:27 UTC (permalink / raw)
To: mingo, bp, x86, hpa; +Cc: kvm, linux-kernel, zuoqilin
From: zuoqilin <zuoqilin@yulong.com>
Simplify the return expression of kvm_compute_tsc_offset().
Signed-off-by: zuoqilin <zuoqilin@yulong.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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-03-26 11:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 11:27 [PATCH] x86: Simplify the return expression zuoqilin1
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).