aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhang songyi <[email protected]>2022-11-23 17:04:45 +0800
committerSean Christopherson <[email protected]>2023-01-24 10:04:33 -0800
commit85e64d09f7934166b77dfbe42eec600c93703cb3 (patch)
treefe1ff71a303e167c4a5d6aacc991909a5fde260e
parent7cb79f433e75b05d1635aefaa851cfcd1cb7dc4f (diff)
KVM: x86: remove redundant ret variable
Return value from apic_get_tmcct() directly instead of taking this in another redundant variable. Signed-off-by: zhang songyi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
-rw-r--r--arch/x86/kvm/lapic.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 7cf4eebc9bcc..08450b3e7040 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1487,7 +1487,6 @@ static u32 apic_get_tmcct(struct kvm_lapic *apic)
{
ktime_t remaining, now;
s64 ns;
- u32 tmcct;
ASSERT(apic != NULL);
@@ -1502,10 +1501,7 @@ static u32 apic_get_tmcct(struct kvm_lapic *apic)
remaining = 0;
ns = mod_64(ktime_to_ns(remaining), apic->lapic_timer.period);
- tmcct = div64_u64(ns,
- (APIC_BUS_CYCLE_NS * apic->divide_count));
-
- return tmcct;
+ return div64_u64(ns, (APIC_BUS_CYCLE_NS * apic->divide_count));
}
static void __report_tpr_access(struct kvm_lapic *apic, bool write)